List CGCalendar events by venue

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
10010110
Translator
Translator
Posts: 214
Joined: Tue Jan 22, 2008 9:57 am

List CGCalendar events by venue

Post 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.)
JohnnyB
Dev Team Member
Dev Team Member
Posts: 729
Joined: Tue Nov 21, 2006 5:05 pm
Location: OH, USA

Re: List CGCalendar events by venue

Post 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}
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
10010110
Translator
Translator
Posts: 214
Joined: Tue Jan 22, 2008 9:57 am

Re: List CGCalendar events by venue

Post 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.
10010110
Translator
Translator
Posts: 214
Joined: Tue Jan 22, 2008 9:57 am

Re: List CGCalendar events by venue

Post by 10010110 »

I’m still looking for a solution on this. If anyone has an idea I’m eager to hear it.
twen88
Forum Members
Forum Members
Posts: 118
Joined: Thu Aug 16, 2007 8:07 pm

Re: List CGCalendar events by venue

Post by twen88 »

how about instead of using a new field, just categorize your events by venue then list it by category?
10010110
Translator
Translator
Posts: 214
Joined: Tue Jan 22, 2008 9:57 am

Re: List CGCalendar events by venue

Post by 10010110 »

That’s not working either because I’m already using categories for – well – categories. :(
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Location: Maidenhead, UK
Contact:

Re: List CGCalendar events by venue

Post 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?
10010110
Translator
Translator
Posts: 214
Joined: Tue Jan 22, 2008 9:57 am

Re: List CGCalendar events by venue

Post 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. ???
Post Reply

Return to “Modules/Add-Ons”