Modifying calendar link button?

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?

Hi there,

Sorry for the confusion! show_calendar_link has some old behavior in LiveWhale 2.x that we’ve revamped in the upcoming LiveWhale 3.0 to be override-able and be much more generally applicable to LiveWhale Calendar. The 2.x version isn’t customizable, unfortunately.

Also, include_stylesheet and include_javascript I’m also pretty certain have a few gaps that we’ve filled in with the 3.0 release – you’ll be hearing from our team as soon as your dev site is ready for 3.0 testing this summer, sounds like some of that functionality will be extra useful for you in this project! Sorry for the hassle in the meantime.

Understandable. We’ll come back to this at a later time then. Thank you!