Examples
Last updated Dec 9th, 2019 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$306 per month—let's make that $500!
Learn moreRevolution¶
Listing Events¶
Generic List of Upcoming Events¶
Display a generic list of events from all calendars and all categories with clickable modal window view.
- Resource ID 49 used for example only (replace with your ajaxResource's ID).
- Omit "&modalView and &ajaxResourceId" parameters for a standard detail view.
- Add duplicated chunks and additional parameters for customized output (more variations and examples coming soon).
[[!mxcalendar?
&eventListlimit=`8`
&displayType=`list`
&ajaxResourceId=`49`
&modalView=`1`
&dir=`ASC`
]]
- Add parameters to display further ahead (default is +4 weeks)
- Omit or alter "&eventListLimit" for more list items (default is 5 list items)
&elStartDate=`now`
&elEndDate=`+16 weeks`
Generic List of Past Events¶
mxCalendar can also display past events. The three parameters you want to look at are:
&elDirectinal=past
- This tells mxCalendar to pull back all calendar events that happened in past thus less than the date supplied in the elStartDate field
&elStartDate=now
- Same as with regular events sets a starting point to filter date range for results
&dir=DESC
- Returns events in the order from most recent to oldest
Example:
(duplicate the tplListItem and tplListWrap chunks, rename, save, and insert into the mxCalendar snippet call as shown below)
[[!mxcalendar?
&displayType=`list`
&elDirectional=`past`
&isLocked=`1`
&resourceId=`71`
&tplListHeading=``
&tplListItem=`tplListItemNewChunk`
&calendarFilter=`2`
&elStartDate=`now`
&tplListWrap=`tplListWrapNewChunk`
&dir=`DESC`
]]
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$306 per month—let's make that $500!
Learn more