<p>There are many ways to paginate:</p>

<h1>To show next / prev links</h1>

<p>#1
<a href="https://craftcms.com/docs/templating/entrymodel#getPrevSibling" rel="nofollow noreferrer">getPrevSibling</a> <a href="https://craftcms.com/docs/templating/entrymodel#getNextSibling" rel="nofollow noreferrer">getNextSibling</a></p>

<pre><code>{% if entry.getPrevSibling %}
    &lt;a href="{{entry.getPrevSibling.url}}"&gt;{{entry.getPrevSibling.title}}&lt;/a&gt;
{% endif %}

{% if entry.getNextSibling %}
    &lt;a href="{{entry.getNextSibling.url}}"&gt;{{entry.getNextSibling.title}}&lt;/a&gt;
{% endif %}
</code></pre>

<p>#2 <a href="https://craftcms.com/docs/templating/entrymodel#getPrev" rel="nofollow noreferrer">getPrev</a> <a href="https://craftcms.com/docs/templating/entrymodel#getNext" rel="nofollow noreferrer">getNext</a></p>

<pre><code>{% set params = {section: entry.section.handle} %}
{% set prev = entry.getPrev(params) %}
{% set next = entry.getNext(params) %}

{% if prev %}
    &lt;a href="{{prev.url}}"&gt;{{prev.title}}&lt;/a&gt;
{% endif %}

{% if next %}
    &lt;a href="{{next.url}}"&gt;{{next.title}}&lt;/a&gt;
{% endif %}
</code></pre>

<h1>To show list of children (single type page)</h1>

<p><a href="https://craftcms.com/docs/templating/paginate" rel="nofollow noreferrer">{% paginate %}</a></p>

<pre><code>{% paginate craft.entries.section('sectionHandle').limit(10) as pageEntries %}

{% for entry in pageEntries %}
    &lt;article&gt;
        &lt;h1&gt;{{ entry.title }}&lt;/h1&gt;
        {{ entry.body }}
    &lt;/article&gt;
{% endfor %}

{% if pageInfo.prevUrl %}&lt;a href="{{ pageInfo.prevUrl }}"&gt;Previous Page&lt;/a&gt;{% endif %}
{% if pageInfo.nextUrl %}&lt;a href="{{ pageInfo.nextUrl }}"&gt;Next Page&lt;/a&gt;{% endif %}
</code></pre>

CC BY-SA 3.0
2016-11-28T11:57:43.387Z
2016-11-28T11:57:43.387Z
Krzysztof Boduch
<p>Or to say it in a different way, paginate siblings.</p>

<p>I found this question on stack: <a href="https://craftcms.stackexchange.com/questions/1203/how-do-you-page-through-child-entries-in-a-structure">How do you page through child entries in a structure?</a> which seems to have a working answer. However trying this myself I get no results.</p>

<p>To be clear, I have a two level structure.</p>

<pre><code>Level 1 (parent)
 - Level 2 (child)
 - Level 2 (child)
 - and so on..
</code></pre>

<p>How can I paginate the children?</p>

<p>Thank you for any input!</p>

<pagination>
Paginate children in a structure
# Paginate children in a structure

(Asked by: username_0 on 2016-11-27)

Or to say it in a different way, paginate siblings.
I found this question on stack: How do you page through child entries in a structure? which seems to have a working answer. However trying this myself I get no results.
To be clear, I have a two level structure.
Level 1 (parent)
 - Level 2 (child)
 - Level 2 (child)
 - and so on..

How can I paginate the children?
Thank you for any input!

**Tags:** pagination


---

## 1 answers

### Answer by username_1 on 2016-11-28. Score: 2 | Accepted answer

There are many ways to paginate:
To show next / prev links
#1
getPrevSibling getNextSibling
{% if entry.getPrevSibling %}
    {{entry.getPrevSibling.title}}
{% endif %}

{% if entry.getNextSibling %}
    {{entry.getNextSibling.title}}
{% endif %}

#2 getPrev getNext
{% set params = {section: entry.section.handle} %}
{% set prev = entry.getPrev(params) %}
{% set next = entry.getNext(params) %}

{% if prev %}
    {{prev.title}}
{% endif %}

{% if next %}
    {{next.title}}
{% endif %}

To show list of children (single type page)
{% paginate %}
{% paginate craft.entries.section('sectionHandle').limit(10) as pageEntries %}

{% for entry in pageEntries %}
    
        {{ entry.title }}
        {{ entry.body }}
    
{% endfor %}

{% if pageInfo.prevUrl %}Previous Page{% endif %}
{% if pageInfo.nextUrl %}Next Page{% endif %}


---

