query multiple categories
-
it would be great to query mutliple categories by slug. this way it’ll be possible to have a grouped display of multiple categories.
in eme_categories.php the function eme_get_category_ids() already returns an array of category ids, but can only handle a single slug as parameter. I’d suggest to allow multiple slugs to be passed and use SQL in-condition. in order to use multiple slug with url-parameters (eme_event_cat), I’d suggest to use a + to join multiple categories.
my current (simple and working) hack in eme_categories.php in function eme_get_category_ids():
- $conditions = " category_slug = '$cat_slug'";
+ $cat_slugs = implode("','", explode("+", $cat_slug));
+ $conditions = " category_slug IN ('$cat_slugs')";
this way it is possible to call an url like:
http://www.domain.com/events/cat/slug1+slug2/kind regards, Tom
The topic ‘query multiple categories’ is closed to new replies.