Can event lists be grouped by month?
Hi,
I've a simple question about the event listings. I hope someone on this brand-new forum will be able to help me :-)
I'd like to list all the events in a year with month headings, like so...
2009
March
* Event A
* Event B
* Event C
April
* Event D
* Event E
July
* Event F
and so on...
Is this possible to do just using templating? I haven't been able to figure out yet how to group the events by month. Am I right in thinking I would need to write a custom extension for this?
Many thanks in advance!
howard
Re: Can event lists be grouped by month?
Actually that is pretty much the standard behaviour of the "event list" module.
Re: Can event lists be grouped by month?
Thanks for replying, Leo.
I've been using the Event List module, set on yearly view, but no combination of settings and templates will make the monthly headers and group the events by month. It just prints the events one at a time with their date next to them, but there's no month-level headers and that's what I was wanting.
Am I missing something really obvious here?
TIA,
Howard.
Re: Can event lists be grouped by month?
You are right, there are no monthly headers by default. Sorry for the misinformation. There is a template variable called $this->newMonth though, which allows you to add the functionality:
Code:
<?php if ($this->newMonth): ?>
<div class="newmonth"><?php echo $this->month; ?></div>
<?php endif; ?>
See ticket #284 for more information.
Re: Can event lists be grouped by month?
Ahh.. that's *perfect*! Just what I was after.
Thank you for answering so quickly and thank you also for Typolight. It's such a good piece of software and I'm happy to have finally found an open source CMS worth using!