I have an ExpressionEngine 3 site. I have 2 separate Category groups:
Course Type (ID = 3)
Course Category (ID = 5)
The hierarchy I want is Course Type > Course Category. For example:
E-Learning (Course Type)
- Health and safety (Course Category)
- Risk management (Course Category)
- etc...
Classroom courses (Course Type)
- Hazards (Course Category)
- Budgets (Course Category)
- etc...
I have a channel called training_courses which has various channel entries assigned to both Course Type and Course Category.
My template has tabs for the Course Type, e.g.
| E-Learning | Classroom courses | ...
What I want to do is show the entries in training_courses that are categorised under both the appropriate Course Type ->Course Category headings. And if there are no entries hide the Course Category heading.
I'm not sure how to achieve this as it seems to rely on multiple queries to exp:channel:categories
I have this...
{exp:channel:categories style="linear" channel="training_courses" show_empty="no"}
... but the problem with that query is that it doesn't differentiate between Course Type and Course Category so it shows a full list, e.g.
- E-Learning
- Health and safety
- Risk management
- Classroom courses
- Hazards
- Budgets
How do I distinguish between these 2 types of category and then pull the channel entries that are under them? Should this just be set up as 1 category with parent/child hierarchy?
The answer to this seems to be that you need to use one category with a parent/child set up.
If anyone has any advice on how to accomplish it with 2 separate ones let me know.
EE is extraordinarily awful when it comes to outputting and filtering categories. From their own documentation
Well, that's great. But what if you want to show the child categories and not the parent ones? slow clap