Created
June 6, 2013 16:42
-
-
Save brandonkelly/5722967 to your computer and use it in GitHub Desktop.
New getNext() / getPrev() support coming to all elements in Craft 1.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set criteria = {section: 'cocktails', order: 'title'} %} | |
{% set prev = entry.getPrev(criteria) %} | |
{% set next = entry.getNext(criteria) %} | |
{% if prev or next %} | |
<div class="pane"> | |
{% if prev %} | |
<p>Previous: <a href="{{ prev.url }}">{{ prev.title }}</a></p> | |
{% endif %} | |
{% if next %} | |
<p>Next: <a href="{{ next.url }}">{{ next.title }}</a></p> | |
{% endif %} | |
</div> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment