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
  • 1
    Have you tried passing an array instead? Like so: {% set thisCalendar = [3,2] %}
    – megatrond
    Commented Aug 25, 2015 at 7:24

1 Answer 1

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 and acknowledge you have read our privacy policy.

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