Events Made Easy › Forums › How do I … › Conditional tags in a sidebar?
Tagged: conditional event list permalink
- This topic has 5 replies, 2 voices, and was last updated 11 years, 2 months ago by Franky.
-
AuthorPosts
-
Sun 22 Sep 2013 at 12:03 #44060AnonymousInactive
Hi,
I’m using your very useful plug-in on my page to organise and display events. However, I’ve come across an issue that I could do with some/advice with.
I have a number of different categories, and I would like the theme sidebar/widget area show future events for the same category of the current event being viewed. E.g. if a football match event page is viewed, then I would like the widget area to show future ‘football’ events.
I can use the [events_list category=6] short-code within the widget area to display events for a specific category. However, I cannot work out how to make this dependent upon the current event being viewed.
If I try :
[events_if tag='#ESC_CATEGORIES' contains='Golf']
[events_list category=6]
[/events_if]
then nothing is displayed – it’s as if the [events_if is not being processed in the widget area? But I know something is being processed in the widget area since the [events_list] short-code on its own will work.
Or alternatively, if this is not possible, could the permalinks be changed from events/ID/EVENTNAME to events/CATEGORY/ID/EVENTNAME? In this case, I can use a context-widget plug-in to selectively display widgets based on the URL.
Thanks, Andy
Sun 22 Sep 2013 at 21:12 #50742FrankyKeymasterevents/cat/<cat_name> already exists as a permalink
[events_if] only works inside events, not surrounding them.
Mon 23 Sep 2013 at 09:02 #50743AnonymousInactiveThank you for your reply.
Re: permalinks. I was thinking about the permalink URL for a event. So currently, an events URL could be http://…/wordpress/events/6/match_1 and http://…/wordpress/events/7/match_2 etc.
Whereas if the events permalink could be changed to include the category then these would become http://…/wordpress/events/football/6/match_1 and http://…/wordpress/events/football/7/match_2.
A context widget would then be able to conditionally disaplay a football-specific widget based on a URL search for events/football.
Mon 23 Sep 2013 at 13:56 #50744FrankyKeymasterThe problem is: what with events in more than one cat? They would have more than one permalink, then it would be impossible which one to show for e.g. basic [event_list] shortcodes.
What *could* be done: when viewing a single event, I could detect the event id, and based upon that I could show other events in the same category (or categories). But this would only be possible when viewing a single event …
Otherwise I would say to just create different pages for each category, and conditionally show the widget restricted to the same category per page as well.
Mon 23 Sep 2013 at 16:53 #50745AnonymousInactiveMust admit didn’t think about events in multiple categories!
When you mention that the event-id *could* be detected – is this likely to be implemented anytime soon?
Thanks for your replies.
Mon 23 Sep 2013 at 22:37 #50746FrankyKeymasterMake a feature request, I’ll start working on new features in 2 weeks 🙂
-
AuthorPosts
- The forum ‘How do I …’ is closed to new topics and replies.