calendarVars()
calendarVars(object $collection) : array
Twig Calendar Vars
Adds a url to the event header and stores each event in an associative
array that can be accessed from calendar.html.twig
via year,
month, and day params. Here is an example of accessing a particular
day on the calendar.
{% for events in calendar.events[calendar.year][calendar.month][day] %}
{% for event in events %}
{% if event.title %}
<div class="event"><a href="{{ event.url }}">{{ event.title }}</a></div>
{% endif %}
{% endfor %}
{% endfor %}
Parameters
object | $collection | Grav Collection |
Returns
array —Calendar variables for Twig