TIP

WE'RE HIRING! 💼

The Solspace team is expanding! If you love Craft CMS and you’re looking for an exciting full-time remote position working on software development for the Freeform and Calendar plugins for Craft and more, we’d love to hear from you!

Check Out Job Listing!

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
Last Updated: 1/15/2020, 4:39:52 PM