Forum
Filter events by category
Hi. New to Perch. Brilliant so far. I'm stuck with the event app though. It works fine with the examples but I would like to display only events from a certain category.
How do I go about this? Any help appreciated.
https://docs.grabaperch.com/addons/events/page-functions/standard/
You can pass in a single category or an array.
Thanks Rachel, that's great - have used that now. I'm still getting to grips with this and don't fully understand how slugs can help with events. I don't suppose you can point me in the direction of a working event using a slug function - if that makes sense.
It doesn't much - can you give an example?
Sorry, will try to explain. I can see that Slugs will be useful for returning Urls, but there are two listed in the template for events - category_slugs and eventSlug. I assumed prior to my question above that the slugs would be used to filter categories, but if the events_custom array can be used to filter categories - why is it needed?
For example I'm trying to find 3 events related to the beach. Rachel's suggestion helped me do the following, but where would you use a Slug relating to events in something below. Just trying to get my head around when it would be best to use slugs that's all.
));
Thanks Steve
I'm not sure what problem you're trying to solve. All a slug is is a URL-safe text identifier for the item.