I'm trying to use different entry types for certain categories. My category group is called categories
, and the slug for Features is features
. I have the category group pointed to categories/_entry
. As for as I can tell, I've got it set up right. I think their might just be something wrong with my switch code. This is my code in categories/_entry
:
{% set categories = entry.categories.first %}
{% switch categories.slug %}
{% case 'features' %}
{% include 'categories/_feature.html' %}
{% case 'news' %}
{% include 'categories/_news.html' %}
{% default %}
{% include 'categories/_news.html' %}
{% endswitch %}
entry
variable? You usually don't have one as a global in your categories template. Do you have a field calledcategories
otherwiseentry.categories
would not make sense but you don't explain that in your question. What error do you receive? Categories do not have an entry type there is no way you can use different entry types for categories. What is yourFeatures
is it a record in your category group? We have not enough information and your question is a little bit confusing because you mixed things together that does not belong together. The code itself seems correct – Robin Schambach Jan 23 '18 at 22:34