Output events with the category that matches the url slug of another page
I have a detail page with the url /open-programmes/core-level-coaching
On that page I want to output events with the category_name that matches the url or page that the event name would relate to ie. page /core-level-coaching outputs events in category='core-level-coaching'. The pages are dynamic and so I can't specify the category in the perch_events_custom tag. If there;s a way of matching the page url to an event category_slug then I will be a happy man :-)
On the /open-programme.php (detail page) I have tried this based on another discussion I read but nothing outputs:
URL = /open-programmes/core-level-coaching
<?php perch_events_custom(array( 'filter' => 'category_slugs', 'match' => 'contains', 'value' => perch_get('s'), 'category' => perch_get('s'), 'template' =>'events/listing/event-list-sidebar.html' )); ?>
Is it possible?
I'm incapable of writing any php that doesn't come out of the box, so I may even be trying to do something here that's not even possible (or possible in a simple way)!
Want to reply to this thread?Login with Perch