This document is for an older version of

Calendar

.

View latest version →

Templating

calendar.calendar function

The calendar.calendar template function fetches a single calendar by its unique ID.

Parameters

  • id #
    • The unique calendar ID
  • name #
    • The name of the calendar
  • handle #
    • The handle for the calendar
  • color #
    • a hex value of the color, e.g - #FFFFFF

Usage in Templates

{% set calendar = craft.calendar.calendar({
  handle: "holidays"
}) %}

{% if calendar %}
  <div style="color: {{ calendar.color }};">
    {{ calendar.name }}
  </div>
{% endif %}
1
2
3
4
5
6
7
8
9