I am using the following code to display an archived list of months from my calendar with clickable links.

    {exp:calendar:month_list date_range_start="{today}"}
            <a href="{path='events/archives'}/{month format="%Y/%m"}"/>
                {month format="%F, %Y"}

I only want to display months that have events in them. Does anyone know how this can be done?

1 Answer 1


The {exp:calendar:cal} tag can do a lot in Calendar: it's the first go-to tag to consider. I would use it since it provides a {month_event_total} variable you could use here. For example:

{exp:calendar:cal date_range_start="2015-01-01" date_range_end="2015-12-31"}
        {if month_event_total > 0}
            // Your month header

That should just display months that have events in them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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