Skip to main content

Calendar:Calendars template tag

The Calendar:Calendars loop outputs information about each calendar.

{exp:calendar:calendars} content {/exp:calendar:calendars}

[[toc]]

​Parameters

Most parameters available in the Channel:Entries loop are available here. Additionally, these are also available:

​site_id=

site_id="1"

If using MSM, you can specify a Site ID in this parameter to filter entries down to that site.

​calendar_id=

calendar_id="1|3"

This parameter allows you to display specific calendars by specifying their entry ID(s). You can hardcode a calendar ID, pass it through an embed, or grab it from the URI. Separate multiples with the pipe character.

​calendar_name=

calendar_name="baseball"

This parameter allows you to display specific calendars by specifying their entry url_title(s). You can hardcode a calendar url_title, pass it through an embed, or grab it from the URI. Separate multiples with the pipe character.

​date_range_start=

date_range_start="2010-01-31 @ 08:00 am"

Limits output to calendars that have events on or after this date. Both standard and easy-to-use text date formatting apply to this parameter.

​date_range_end=

date_range_end="2010-02-14 @ 10:00 pm"

Limits output to calendars that have events on or before this date. Both standard and easy-to-use text date formatting apply to this parameter.

​limit=

limit="5"

This parameter lets you limit the number of calendars to be displayed.

​offset=

offset="1"

This parameter lets you offset the results of calendars displayed. For example, if you'd like the first result to be skipped from the results, specify a value of 1.

​paginate=

paginate="both"

This parameter allows you to control where the pagination will display. Options are top, bottom, or both. Used in conjunction with the paginate variable pair.

​Variables

Most variables available in the Channel:Entries loop are available here. Additionally, these are also available:

​calendar_title

{calendar_title}

This variable outputs the title of the calendar channel entry.

​calendar_url_title

{calendar_url_title}

This variable outputs the URL title of the calendar channel entry.

​calendar_id

{calendar_id}

This variable outputs the entry ID of the calendar channel entry.

​calendar_tz_offset

{calendar_tz_offset}

This variable outputs the timezone offset selected for the calendar.

​calendar_ics_url

{calendar_ics_url}

This variable outputs the URL of ICS file(s) to be imported into this calendar.

​calendar_status

{calendar_status}

This variable outputs the status of the calendar entry.

​calendar_author

{calendar_author}

This variable outputs the screen name of the author of the calendar entry.

​calendar_author_id

{calendar_author_id}

This variable outputs the member ID of the author of the calendar entry.

​Variable Pairs

Most variable pairs available in the Channel:Entries loop are available here. Additionally, these are also available:

​paginate

{paginate}Page {current_page} of {total_pages} pages   {pagination_links}{/paginate}

Pagination is available for this tag and works just like regular pagination. Used in conjunction with the paginate parameter.

​Conditionals

Most conditionals available in the Channel:Entries loop are available here. Additionally, these exist as well:

​calendar_no_results

{if calendar_no_results}{/if}

Works just like the regular {if no_results} conditional - displays its contents when there is no results for the given parameters.

​Examples

The following code example will display information about a given calendar if its url_title is in the 3rd segment of the URI, or it’ll otherwise list all available calendars:

{exp:calendar:calendars {if segment_3 != ""} calendar_name="{segment_3}" {/if} }
<div class="calendar">
<div class="title">
<h1>{calendar_title}</h1>
</div>
<div class="body">{calendar_summary}</div>
<ul>
<li>Calendar Shortname: {calendar_url_title}</li>
<li>Calendar ID: {calendar_id}</li>
<li>Calendar TZ Offset: {calendar_tz_offset}</li>
<li>Calendar .ics URL: {calendar_ics_url}</li>
</ul>
</div>
{/exp:calendar:calendars}