AgendaList
This snippet displays events in a list.
Properties
It uses the following snippet properties:
| Property | Description | Default | 
|---|---|---|
| active | Since 1.6.3 If this option is disabled, the active status of an event is not regarded. | 1 (Yes) | 
| ajax | Since 1.4.0 If set, the snippet output will be directly returned to the browser as a JSON result when the page is requested with the same value in the ajax request parameter. | 0 (No) | 
| allowedRequestKeys | Comma-separated list of request keys, that can be used to filter the displayed events. Defaults to all allowed. | - | 
| calendars | Comma-separated list of aliases of calendars to filter the displayed events. | - | 
| calendarsJunction | Since 1.7.0 Database query junction between multiple values in the calendars snippet property. Can be set to AND and OR. | - | 
| categories | Comma separated list of aliases of categories to filter the displayed events. | - | 
| categoriesJunction | Since 1.7.0 Database query junction between multiple values in the categories snippet property. Can be set to AND and OR. | - | 
| categoryTpl | Name of a chunk that contains the template of one category in the category list of an event. | tplAgendaEventCategory | 
| contexts | Comma separated list of context keys to filter the displayed events. | - | 
| contextsJunction | Since 1.7.0 Database query junction between multiple values in the contexts snippet property. Can be set to AND and OR. | - | 
| daterangeFormat | Format of the daterange displayed in an event. | - | 
| daterangeSeparator | Separator in the daterange displayed in an event. | - | 
| detailId | ID of a resource containing an AgendaDetail snippet call. | - | 
| downloadTpl | Since 1.7.0 Name of a chunk that contains the template for one download in the download list of an event. | tplAgendaEventDownload | 
| durationParts | Number of detail parts of the event duration output. | 1 | 
| durationRound | Since 1.5.0 Rounding type for event duration. | ceil | 
| emptyTpl | Name of a chunk that contains the template for an empty list of events. | tplAgendaEventEmpty | 
| end | The end date to filter the displayed events. Must contain a supported date and time format. | today +1 month 0:00 | 
| events | Comma separated list of event IDs to filter the displayed events and their repeats. Supersedes the repeats property. | - | 
| excludeEvents | Comma separated list of event IDs to exclude from the displayed events. | - | 
| excludeRepeats | Comma separated list of repeating event IDs to exclude from the displayed events. | - | 
| groupby | Since 1.5.0 xPDO group by clause to filter the events. | - | 
| imageTpl | Name of a chunk that contains the template for one image in the image list of an event. | tplAgendaEventImage | 
| limit | Limit the number of events in the result. Use "0" for unlimited events. | 20 | 
| listId | ID of a resource containing an AgendaList snippet call. | - | 
| locale | The locale for the displayed formatted date. Defaults to the current system/context locale setting. | - | 
| locations | Comma separated list of aliases of locations to filter the displayed events. | - | 
| locationsJunction | Since 1.7.0 Database query junction between multiple values in the locations snippet property. Can be set to AND and OR. | - | 
| locationTpl | Name of a chunk that contains the template for the location of an event. | tplAgendaEventLocation | 
| offset | The offset of events to skip. | - | 
| outputSeparator | An optional string to separate each tpl instance. | - | 
| repeats | Comma separated list of repeating event IDs to filter the displayed repeating events. Overridden by the events property. | - | 
| resourceTpl | Name of a chunk that contains the template for the linked resource of an event. | - | 
| sortby | Sort field for sorting the output. It can also contain a JSON object to sort the ouput by multiple fields like {"AgendaEvents.title":"ASC","all_startdate":"ASC"}. | all_startdate | 
| sortdir | Sort direction for sorting the output. Unused when the sortby property contains a valid JSON object. | ASC | 
| start | The start date to filter the displayed events. Must contain a supported date and time format. | today 0:00 | 
| toPlaceholder | If set, the snippet result will be assigned to this placeholder instead of outputting it directly. | - | 
| totalVar | The key of a placeholder that indicates the total number of events. | agendalist.total | 
| tpl | Name of a chunk that contains the template for one event. | tplAgendaEventRow | 
| useCursus | Since 1.7.2 Bypass the cursus.event_where system setting and don’t fill unnecessary Cursus placeholders. | 1 (Yes) | 
| usergroups | Comma separated list of user group names to filter the displayed events. | - | 
| usergroupsJunction | Since 1.7.0 Database query junction between multiple values in the usergroups snippet property. Can be set to AND and OR. | - | 
| users | Comma separated list of user IDs to filter the displayed events. | - | 
| usersJunction | Since 1.7.0 Database query junction between multiple values in the users snippet property. Can be set to AND and OR. | - | 
| videoTpl | Name of a chunk that contains the template for one video in the video list of an event. | tplAgendaEventVideo | 
| weekday | Since 1.7.0 Number of a weekday to filter the displayed events. 1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday, 7 = Sunday. | - | 
| where | Since 1.5.0 JSON-encoded xPDO where clause to filter the displayed events. | - | 
| wrapperTpl | Name of a chunk that contains the wrapper template for all events. | tplAgendaEventWrapper | 
Placeholders
The following placeholders are available in the different (default) chunks. Each
snippet property will be set as placeholder in each template chunk, i.e. a
snippet call [[!AgendaDetail? &subtitle=`whatever`]] will fill the
placeholder subtitle in each used chunk with the value whatever.
CAUTION: The default template chunks for both snippets are overwritten during each package update, so please rename the chunks before editing them.
tplAgendaEventRow
| Placeholder | Description | 
|---|---|
| allday | Contains 1 if the event is an all day event (otherwise 0). | 
| calendar_background | The background color of the calendar of the event. | 
| calendar_foreground | The foreground color of the calendar of the event. | 
| calendar_name | The calendar name. | 
| categories | All categories of the event formatted by the chunk set with the categoryTpl property. | 
| content | The content of the event. | 
| description | The description of the event. | 
| detail_url | The url that shows the event detail. Will be generated with the system/context setting agenda.detail_id. This resource should contain an AgendaDetail snippet call. | 
| duration | The formatted duration of the event. The details of the duration can be set with the durationPartssnippet property. | 
| enddate | The start date of the event formatted in ISO 8601 (can be formatted i.e. with [[+enddate:strtotime:date=`%a. %d.%m.%Y`]]). | 
| idx | The number of the event starting with 1. | 
| images | All images of the event formatted by the chunk set with the imageTpl property. | 
| imageurls | An array of all image urls. The placeholder [[+imageurls.1]]contains the url of the first image | 
| location | The location of the event formatted by the chunk set with the locationTpl property. | 
| main_description | The description of the main event (useful for repeating events). | 
| main_location | The location of the main event formatted by the chunk set with the locationTpl property (useful for repeating events). | 
| main_resource_id | The id of a linked resource of the main event (useful for repeating events). | 
| main_title | The title of the main event (useful for repeating events). | 
| range | The formatted date range of the event. The format is defined with the lexicon entries agenda.php_format_daterangeandagenda.php_format_separatorand can be overridden by thedaterangeFormatsnippet property. The format rules are described below. | 
| repeating | Contains 1 if the event is an repeating event (otherwise 0). | 
| repeating_id | The id of the event date if the event is a repeating event. | 
| resource_id | The id of a linked resource of the event. | 
| startdate | The start date of the event formatted in ISO 8601 (can be formatted i.e. with [[+startdate:strtotime:date=`%a. %d.%m.%Y`]]). | 
| title | The title of the event. | 
| videos | All videos of the event formatted by the chunk set with the videosTpl property. | 
| videourls | An array of all video urls. The placeholder [[+videourls.1]]contains the url of the first video. | 
Extended fields are available as placeholder with the prefix extended in the
event row template.
If the tpl property contains a not found chunk, all possible placeholders are displayed with print_r.
tplAgendaEventWrapper
| Placeholder | Description | 
|---|---|
| count | Count of the events filtered by the snippet properties (without limit/offset) | 
| output | All events collected by the snippet separated by the string in the outputSeparator property | 
If the wrapperTpl property contains a not found chunk, all possible placeholders are displayed with print_r.
tplAgendaEventEmpty
Only the current script properties are available as placeholders.
If the emptyTpl property contains a not found chunk, all possible placeholders are displayed with print_r.
tplAgendaEventCategory
| Placeholder | Description | 
|---|---|
| alias | The alias of the category. | 
| background | The background color of the category of the event. | 
| foreground | The foreground color of the category of the event. | 
| name | The name of the category. | 
| resource_id | The id of a linked resource of the category. | 
| selected | Contains selected="selected", when the category request value is equal to the alias of the category. | 
| url | The url that shows the event list filtered by the displayed category. Will be generated with the system/context setting agenda.list_id. This resource should contain an AgendaList snippet call. | 
If the categoryTpl property contains a not found chunk, all possible placeholders are displayed with print_r.
tplAgendaEventImage
| Placeholder | Description | 
|---|---|
| description | The description of the image. | 
| idx | The number of the image starting with 1. | 
| title | The title of the image. | 
| url | The url that shows the event image. | 
If the imageTpl property contains a not found chunk, all possible placeholders are displayed with print_r.
tplAgendaEventLocation
| Placeholder | Description | 
|---|---|
| address | The address of the location. | 
| alias | The alias of the location. | 
| center_lat | The latitude of the center of a map of the location. | 
| center_lng | The longitude of the center of a map of the location. | 
| description | The description of the location. | 
| lat | The latitude of the location. | 
| lng | The longitude of the location. | 
| name | The name of the location. | 
| resource_id | The id of a linked resource of the location. | 
| selected | Contains selected="selected", when the location request value is equal to the alias of the location. | 
| zoom | The zoom level of a map of the location. | 
If the locationTpl property contains a not found chunk, all possible placeholders are displayed with print_r.
tplAgendaEventVideo
| Placeholder | Description | 
|---|---|
| description | The description of the video. | 
| idx | The number of the video starting with 1. | 
| title | The title of the video. | 
| url | The url that shows the event video. | 
If the videoTpl property contains a not found chunk, all possible placeholders are displayed with print_r.
Range placeholder format
The range placeholder can be formatted with the lexicon entries
agenda.php_format_daterange and agenda.php_format_separator or the snippet
properties daterangeFormat and daterangeSeparator. The format string has to
use exactly 7 parts separated by |. The default english lexicon entry is 
j.| F |Y|, |g|:i a|. The format string can use the format placeholders of DateTime::format
The daterrange is formatted with the following rules:
- If both dates are different and the hour/minute of start and end is 0, parts 4-7 are removed from start and end date.
- If both dates are different and the hour/minute of start and end is 0 and year of start and end is equal, parts 4-7 are removed from start and end date and part 3 is removed from start date.
- If both dates are different and the hour/minute of start and end is 0 and year and month of start and end are equal, parts 4-7 are removed from start and end date and parts 2-3 are removed from start date.
- If both dates are different and the hour/minute of start and end is 0 and year, month and day of start and end are equal, parts 4-7 are removed from start and end date and parts 1-3 are removed from start date.
- If both dates are different and the hour/minute of start and end is not 0 and one detail of year, month and day of start and end is not equal, all parts are used in the start and end date.
- If both dates are different and the hour/minute of start and the hour of end is 0 and all details of year, month and day of start and end are equal, parts 4-7 are removed from start date.
- If both dates are different and the hour or minute of start or the hour of end not 0 and all details of year, month and day of start and end are equal, part 7 is removed from start date.
- If both dates are equal and the hour/minute of start is 0, part 4-7 is removed from the start date and separator and end date are removed.
- If both dates are equal and the hour/minute of start is not 0, separator and end date are removed.