We’re trying to utilize the show_calendar_link feature (“Include a link to a calendar for these items?”), but we notice that it seems hardcoded to render as “View full calendar >”. We’re trying to use Javascript to override it, and it seems to work fine in the preview, but not when the widget is embedded on another page.
Here’s the line in the widget arguments:
<arg id="include_javascript">/_ingredients/widgets/js/simple-list.js</arg>
And here’s the JS file:
((simpleList) => {
if (simpleList) {
const button = simpleList.querySelector('.lw_calendar_link a');
if (button) {
button.textContent = 'View full calendar';
}
}
})(document.querySelector('.simplelist.featured_events_list'));
Do you know what we might be doing wrong here? Is there a better or easier way to modify that button?