Migrate to Modular Templates

Calendar templates and components in LiveWhale have been “modular” for some time, but starting in LiveWhale 1.7 we no longer support non-modular templates. Modular templates give you the greatest level of flexibility in terms of how your calendar looks.

Do I need to update?

If you’re using non-modular calendar components, you’ll see one or more of the following files inside your theme:

  • /templates/calendar.html
  • /templates/calendar-components.html
  • /components/calendar.html
  • /components/calendar-components.html

These combined files contain a series of <script> tags, each containing the HTML for an individual calendar component.

With modular templates, we no longer use those two combined files and instead, each component gets its own file inside /components/calendar/. Components that you haven’t customized will fall back to the core version, like every other type of theme file.

How to switch to modular components

Step 1: See which components are customized

Save the following script and upload it to /livewhale/private.

Then log in to LiveWhale and visit it from a browser. This script will scan for calendar.html and calendar-components.html in your themes, and then compare each component to the core theme. If a component is different, it will tell you.

Step 2: Copy customized components to individual files

Using the list generated in Step 1, copy each customized component into its new location. For instance, if your theme has a /templates/calendar.html file containing a customized <script id="lw_cal_event_detail_template" type="text/template">, you’ll be prompted to copy that component into its own file, /components/calendar/lw_cal_event_detail.html.

Step 3: Enable modular templates

For the time being, you’re likely doing this test/dev work on a server that still support non-modular templates. To test the new modular location, add the following to your calendar settings:

<arg id="use_modular_templates">true</arg>

(In a CORS calendar, the JS version of this setting is use_modular_templates:true,)

Step 4: Remove the old non-modular files

Once you’re certain the above steps have worked, you can delete any calendar.html or calendar-components.html files from your theme(s).