I have a structure like below and need previous / next links on an entry such that they go back and forth between E, F, G and H. They shouldn't step into D or I.
I've been trying this, but I can't get it not to step into D or I.
{% set prev = entry.getPrev({section: 'mySection'}) %}
{% if not prev %}
{% set prev = craft.entries.section('mySection').last() %}
{% endif %}
{{ prev.title }}
{% set next = entry.getNext({section: 'mySection'}) %}
{% if not next %}
{{ craft.entries.section('mySection').order('lft desc').first().title }}
{% endif %}
{{ next.title }}
- A
- B
- C
- D
- E
- F
- G
- H
- I
- J
- K
- L
- M
- N
- O
- P