First, I highly recommend having a look at this documentation page explaining the differences between some of the more common Calendar tags. Always useful:
http://www.solspace.com/docs/calendar/getting_started/
In detail, if you're looking to create a chronological list of events/occurrences, use {exp:calendar:cal}
. This is the only tag that will make the necessary calculations to list your occurrences in chronological order. Each occurrence will be listed chronologically, with {event_start_date}
displaying the start date of each occurrence:
{exp:calendar:cal
date_range_start="1 month ago"
date_range_end="+1 month"
pad_short_weeks="n"}
{events}
[{event_id}] {event_title} - {event_start_date format="%Y-%m-%d"}<br />
{/events}
{/exp:calendar:cal}
Occurrences do not have their own occurrence_id unless the occurrence is edited in the Control Panel. By default the ID is the same as the "master" event_id set up in the "Calendar: Events" channel entry form.
To print out information about a single occurrence (for a specific day, for example), a good solution is to pass three elements in the URL:
- The start date
- The end date (if different from the start date)
- The "master" event_id
For example, if you want to display occurrence data for 2013-08-19 (for master event "123"), make a URL like this:
http://mysite.com/calendar/event/2013/08/09/123
...and use {exp:calendar:cal} to "zoom in" on that occurrence:
<h3>Occurrence details:</h3>
{exp:calendar:cal
date_range_start="{segment_3}-{segment_4}-{segment_5}"
date_range_end="{segment_3}-{segment_4}-{segment_5}"
pad_short_weeks="n"
event_id="{segment_6}"
}
{events}
{event_title} occurrence data:<br />
Starts on {event_start_date format="%Y-%m-%d"}<br />
Ends on {event_end_date format="%Y-%m-%d"}<br />
{/events}
{/exp:calendar:cal}
Of course you can change the structure of the URL to be
http://mysite.com/calendar/event/2013-08-09/123
...and use {exp:calendar:cal} accordingly:
{exp:calendar:cal
date_range_start="{segment_3}"
date_range_end="{segment_3}"
pad_short_weeks="n"
event_id="{segment_4}"
}
// the rest of the code...