Page 1 of 1
List CGCalendar events by venue
Posted: Tue Sep 02, 2014 1:03 pm
by 10010110
I have an event calendar using CGCalendar with a custom field called “Venue”. On one page I’m listing all the events in the classical manner (i. e. sorted by date) but on another page I want to have a list of venues and then the events happening at each venue listed under (or besides) it. So, what’s the way to list events by a custom field?
(It’s sufficient to list the events of the current year only, i. e. to use the yearlist template.)
Re: List CGCalendar events by venue
Posted: Tue Sep 02, 2014 3:42 pm
by JohnnyB
I think I used a separate template for this in the past and then did some if/then logic to test the custom field's value.
{if $event.fields.Venue == 'New York}
Then do something
{/if}
Re: List CGCalendar events by venue
Posted: Tue Sep 02, 2014 8:00 pm
by 10010110
Thanks but it’s not going to work this way because there are a lot of different venues and they are constantly changing.
Let me just think out loudly here, and correct me if I’m wrong:
How about looping through the events and creating an associative array with the venues as key and the event data as values, and then looping through that array again and creating the new list? Or am I making things more complicated than necessary? It doesn’t quite feel right, somehow.
Re: List CGCalendar events by venue
Posted: Thu Sep 04, 2014 2:49 pm
by 10010110
I’m still looking for a solution on this. If anyone has an idea I’m eager to hear it.
Re: List CGCalendar events by venue
Posted: Fri Sep 05, 2014 12:20 am
by twen88
how about instead of using a new field, just categorize your events by venue then list it by category?
Re: List CGCalendar events by venue
Posted: Fri Sep 05, 2014 8:09 pm
by 10010110
That’s not working either because I’m already using categories for – well – categories.

Re: List CGCalendar events by venue
Posted: Sun Sep 07, 2014 12:01 am
by paulbaker
10010110 wrote:That’s not working either because I’m already using categories for – well – categories.

But that's not going to stop you adding one category per venue and filtering by that though, is it?
Re: List CGCalendar events by venue
Posted: Sun Sep 07, 2014 10:42 am
by 10010110
paulbaker wrote:
But that's not going to stop you adding one category per venue and filtering by that though, is it?
It probably wouldn’t be if I was the only one managing the site but it’s confusing if someone else comes in. Also, there are several event categories so I would have to exclude each one in some if/else statement. And also, there are a lot of venues that are also changing every year so it would be
very suboptimal user experience/interaction wise to have venues as categories.
There
must be a way to filter/retreive events by custom fields.
