How can I write:
- is segment 3, and is not itemA and is not itemB?
- both itemA and itemB are segment 3 as well.
{% if craft.app.request.getSegment(3) and craft.request.getSegment(3) !== 'itemA' and craft.request.getSegment(3) !== 'itemB' %}
To clarify, I want to target a category that is segment 3, but I want to omit two other categories that are on the same segment(level):
- Topics Category
- Subcategory
- Subcategory
- itemA(omit)
- itemB(omit)
- itemC(yes)
- itemD(yes)
In code, I want to achieve this:
{% if craft.request.getSegment(2) == 'Subcategory' %}
// do something
{% elseif craft.app.request.getSegment(3) and craft.request.getSegment(3) !== 'itemA' and craft.request.getSegment(3) !== 'itemB' %}
// do other stuff
{% else %}
// do a generic thing
{% endif %}