0

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!

  • Shouldn't that be date_range_start="today" (i.e. not end)? date_range_start="" and date_range_end="" parameters default to "today" if you don't mention them. – Solspace Oct 28 '14 at 2:59
  • I was thinking end because I wanted it to be in the past. Something like ending today and going back XX years... – Mike Stecker Oct 28 '14 at 17:01
  • In that case you would use something like this: date_range_start="6 months ago" date_range_end="today" – Solspace Nov 3 '14 at 2:57
0

This is a confirmed bug. Unfortunately, we don't have an ETA for a fix.

In the meantime, a workaround could be to repeat {exp:calendar:cal} individually for each year. The {exp:calendar:date} tag can be used to make calculations such as knowing what year is next year, what year is 2 years from now, etc: http://www.solspace.com/docs/calendar/date/

| improve this answer | |
  • Could you share an example to point me in the right direction? Maybe a Gist? – Mike Stecker Oct 28 '14 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.