Does anyone know if/how I can create a "yearly" archives list with Solspace Calendar? I've tried searching the web and can't find anything that works. I want to only display the years where there are events in the year.
Theoretically, this code should work:
{exp:calendar:cal event_id="{embed:ids}" date_range_end="today" show_years="30" dynamic="off"}
{display_each_year}
<li>{date format="%Y"} - {year_event_total}</li>
{/display_each_year}
{/exp:calendar:cal}
But when I use this on my page, it only shows a single year (with the year of the show_years
param), and the {year_event_total}
tag doesn't seem to be populating correctly.
So for my local test, I have 3 events in my system. One from last year, another coming up next week and another even dated out 1 year in the future. I expect to see:
- 2013 - 1
- 2014 - 1
- 2015 - 1
But I am only getting:
- 1985 - 1
Even though no events are in the system beyond the scope of what I mentioned earlier.
Also, the {embed:ids}
in my code above is a piped list of ID's related to an entry in another channel using Playa. You can remove that code because it doesn't seem make any difference in the results. But my plan is to use it as a filter.
Any help would be appreciated!
date_range_start="today"
(i.e. notend
)?date_range_start=""
anddate_range_end=""
parameters default to "today" if you don't mention them.end
because I wanted it to be in the past. Something like ending today and going back XX years...date_range_start="6 months ago" date_range_end="today"