Hi everyone!
A pretty simple question.
I have a collection page (say for 'animals'), and its children pages ('pelican', 'lion', etc).
I'm trying to add next/page links to sibling pages in a same collection. I put together this, which seems to work fine:
{% if page.isLast(page.path) == false %}
<a href="{{page.prevSibling(page.path).url }}">next</a>
{% endif %}
{% if page.isFirst(page.path) == false %}
<a href="{{page.nextSibling(page.path).url }}">prev</a>
{% endif %}
My question is: if the current page is, say, the first in the collection ('Antelope'), how can I add a rule so that prev links to the last page in the collection (say, 'West Highland Terrier')? And vice versa.
Cheers,