Calendars

On this page

Overview

Below you can see all the available drops on the calendars object


Name Description
calendars.now Returns formated DateTime.now
calendars.today Returns formated Date.today
calendars.ics_url The URL of ics (where you can download a file to subscribe to your calendar)
calendars.all for calendar in calendars.all
calendars.events for event in calendars.events.10
calendars.ongoing_events Returns all ongoing events for all calendars
for event in calendars.ongoing_events.10
calendars.upcoming_events Returns all upcoming events for all calendars
for event in calendars.upcoming_events.10
calendars.ongoing_and_upcoming_events Returns all ongoing and upcoming events for all calendars.
for event in calendars.ongoing_and_upcoming_events.10
calendars.monthly_archive Generate a montly archive array.
Returns an `Array` with `CalendarArchiveDrop` objects.

 

Snippets


General

To loop through all existing calendars for the current locale we use:

{% for calendar in calendars.all %} <p>{{ calendar.name }}</p> {% endfor %}

To fetch a specific calendars we call the calendar url:

{% assign my_cal = calendars.my_cal %} {{ my_cal.name }}

We can also use the array syntax: calendars['my_cal']

 


Monthly Archive

To loop through available monthly archives

{% for archive in calendars.monthly_archive %}
   <a href="{{ archive.url }}">{{ archive.month }} {{ archive.year }}</a>
{% endfor %}

Get events in archive

{% for event in archive.events.3 %}
   {{ event.title }}
{% endfor %}

 


Exporting Calendars

WM3 events can now be exported. It can be downloaded as an .ics file (iCalendar) or the link itself can be used if the user calendar application supports calendars by url, for example google calendar supports and it will periodically synchronise the events.

To get the url, use the following liquid methods:

<p>{{ calendars.ics_url }}</p>       # events from all calendars
<p>{{ calendars.name.ics_url }}</p>  # events from calendar with that name

 


Calendars - Advanced

Filter by calendars - When retrieving events directly from the calendars drop, you are able to filter them by calendar urls. only_cal1_cal2 will allow you to retrieve events that belong to either 'cal1' or 'cal2'. except_cal1_cal2 will allow you to retrieve events that do not belong to 'cal1' and 'cal2'. For example:

{% for event in calendars.events.only_cal1.10 %}
  <div>{{ event.title }}</div>
{% endfor %}

Updated: 2020-11-24