Calendar:Mini template tag
The Calendar:Mini loop outputs a one month mini calendar focused on a specific months events. It's a shortcut to using the complex Calendar:Cal function. Unlike most ExpressionEngine tags, the {exp:calendar:mini}{/exp:calendar:mini}
tags alone will output a pre-templated display. Using the parameters and variables below, you can filter and format the results further. Defaults to loading events for current month.
{exp:calendar:mini} content {/exp:calendar:mini}
Parameters
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="soccer|baseball|dodgeball"
This parameter allows you to display specific calendars by specifying their short_names (entry url_title). You can hardcode a short_name, pass it through an embed, or grab it from the URI. Separate multiples with the pipe character.
event_id=
event_id="23|77"
This parameter allows you to display specific events by specifying their entry ID(s). You can hardcode an event ID, pass it through an embed, or grab it from the URI. Separate multiples with the pipe character.
event_name=
event_name="best_event_evar|christmas|pie_day"
This parameter allows you to display specific events by specifying their short_names (entry url_title). You can hardcode a short_name, 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-01"
This parameter allows you to specify a specific month to display events for. If this parameter is NOT specified, then the current month is displayed. Both standard and easy-to-use text date formatting apply to this parameter.
first_day_of_week=
first_day_of_week="0"
By default, Calendar considers Sunday as the first day of the week. This parameter allows you to override that by specifying the numeric value of a weekday (ex: Sunday = 0
, Monday = 1
, etc).
enable=
enable="categories|category_fields|custom_fields|member_data|pagination"
By default, this function does not grab any advanced channel data in order to improve performance. However, opposite to the EE Channel module's disable parameter, this parameter allows you to enable some or all of those features when you need them. Separate multiples with the pipe character. Options are: categories
, category_fields
, custom_fields
, member_data
and pagination
.
Variables
Most of the variables listed in Calendar:Events are available for use here. Formatting variables are not needed as the Calendar:Mini loop will do that for you. However, should you need to use any, all relevant variables from Calendar:Cal (prepended with month_
) are available for use here.
Conditionals
Most of the conditionals listed in Calendar:Events are available for use here. Formatting conditionals are not needed as the Calendar:Mini loop will do that for you. However, should you need to use any, all relevant conditionals from Calendar:Cal (prepended with month_
) are available for use here.
Examples
Easy
This single set of code will output a mini Calendar for you. This is thanks to the preloaded template pack included with Calendar. The {exp:calendar:mini}{/exp:calendar:mini}
tags act almost like an {events}{/events}
variable pair for formatting the events (see Calendar:Events Documentation for list of available variables and conditionals):
<html>
<head>
<title>Mini Calendar</title>
<link
rel="stylesheet"
type="text/css"
href="/themes/third_party/calendar/templates/mini.css"
/>
</head>
<body>
<div id="mc_wrap">
<div id="mc_calendar">{exp:calendar:mini} {/exp:calendar:mini}</div>
</div>
</body>
</html>