0

I have a section (structure) called "blog" but "blog" is not in the URL.

I have entries like:

Entry 1a
--Entry 1b
----Entry 1c
Entry 2a
---Entry 2b

A navigation like:

Overview <- a template in the root directory
Entry 1a
Entry 2a

I need to set "Overview" to active on all entries. Entry 1a should be active if itself or child's are shown. Entry 2a should be active if itself or child's are shown.

Doing this by hand for all entries would be a pain:

{% if craft.request.firstSegment == 'Entry 1a or Entry 1b' %}active{% endif %} 
2
  • Have you tries using levels? something like {% if entry.level == 1 %}active{% endif %} Commented Aug 7, 2019 at 12:34
  • @KSPR 1a and 2a or 1b and 2b are on the same level. So it wont work. Commented Aug 7, 2019 at 15:43

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.