Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Event Calendar: Grouping By Category


Reply


3 Posts   790 Views

Avatar
DanStephenson

Community Member, 116 Posts

19 October 2011 at 9:17am

Edited: 19/10/2011 6:18pm

Hello, if we use the "Extending the Event Calendar" tutorial as an example (http://doc.silverstripe.org/old/recipes:extending_the_event_calendar?s=recipes%252520calendar), there are two things I am trying to achieve, and hope someone can help me with them.

1. When a user has selected a date via the Calendar Widget or the Filter form, I want to group the events by category. So instead of just displaying them all in cronological order, I want to be able to display events groups by category, chronologically:

October 18, 2011

FINANCE
Workshop 9:00am
Workshop 10:00am
Workshop 3pm

ADMINISTRATION
Workshop 11:00am
Workshop 1:pm

-----------------
Right now I have this setup so each "category" is really a calendar, and then there is one master calendar that pulls all the dates (which is the one that the user queries). I figured categories would be an easier way to solve the problem, but I am open for either way!

Avatar
redactuk

Community Member, 117 Posts

1 November 2011 at 12:14pm

I wanted to achieve this also, but in the end decided to cheat. Knowing my groups were fixed and there were only three, I just inserted my template loop three times in the template, the build a custom condition to test the category type for each. So for the first loop I only output events from the first category, in the 2nd loop only events from the 2nd category etc..

A dirty solution yes, but in my case as my groups were fixed save me writing whole load of extensions or even rewriting part of the mod.

Avatar
DanStephenson

Community Member, 116 Posts

3 November 2011 at 6:54am

I considered the same thing, but my groups are going be changing.