3

I am using Michael Rog's Calendar add-on with these params:

{% switch craft.request.getSegment(2) %}
    {% case '' %}
        {% set thisCalendar  = '2,3' %}
        {% set calendarTitle = 'Full Calendar' %}
    {% case 'mts' %}
        {% set thisCalendar  = '2' %}
        {% set calendarTitle = 'MTS Calendar' %}
    {% case 'day-school' %}
        {% set thisCalendar  = '3' %}
        {% set calendarTitle = 'Day School Calendar' %}
{% endswitch %}

{% set calendarParams = {
    dateRangeStart: 'today',
    dateRangeEnd: '+36 months',
    calendarId: thisCalendar
    } %}

The individual calendars are working and showing the correct entries but without a segment 2 I am only getting the events from Calendar ID 2 but not from ID 3.

If I do this:

    {% case '' %}
        {% set thisCalendar  = '3,2' %}

I get events from Calendar ID 3 but not from ID 2.

How do I get events from all calendars? Is comma separated the correct syntax? Should this be working?

  • 1
    Have you tried passing an array instead? Like so: {% set thisCalendar = [3,2] %} – megatrond Aug 25 '15 at 7:24
1

Posting comment as answer, since the suggested solution solved it:

Pass the IDs as an array instead of comma separated: {% set thisCalendar = [3,2] %}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.