Results 1 to 5 of 5

Thread: Can event lists be grouped by month?

  1. #1
    New user
    Join Date
    06-20-09.
    Posts
    8

    Default 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

  2. #2
    Core developer
    Official Contao Team
    leo's Avatar
    Join Date
    06-04-09.
    Location
    Wuppertal, Germany
    Posts
    201

    Default Re: Can event lists be grouped by month?

    Actually that is pretty much the standard behaviour of the "event list" module.

  3. #3
    New user
    Join Date
    06-20-09.
    Posts
    8

    Default 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.

  4. #4
    Core developer
    Official Contao Team
    leo's Avatar
    Join Date
    06-04-09.
    Location
    Wuppertal, Germany
    Posts
    201

    Default 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.

  5. #5
    New user
    Join Date
    06-20-09.
    Posts
    8

    Default 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!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •