<p>Not sure about the Mijingo tutorial, but pretty sure you need to change this:</p>

<pre><code>{% paginate craft.entries.section('posts').limit(8) as postEntries %}
</code></pre>

<p>To this:</p>

<pre><code>{% paginate craft.entries.section('posts').limit(8) as paginate, postEntries %}
</code></pre>

<p>If that doesn't work, then there is probably a conflict with your using <code>paginate</code> as a variable inside the <code>{% paginate %}</code> tag.</p>

<p>You should update it to be something else like the example in the <a href="https://craftcms.com/docs/templating/paginate" rel="nofollow">pagination docs</a>.</p>

CC BY-SA 3.0
2016-10-23T20:38:36.003Z
It does not work.
Hellyar
CC BY-SA 3.0
2016-10-23T20:52:33.820Z
But the pagination docs approach works.  Good enough for me.
Hellyar
CC BY-SA 3.0
2016-10-23T20:31:57.887Z
2016-10-23T20:31:57.887Z
Brad Bell
<p>A couple of years later, I ran into the same issue. In case there are others looking, it looks like this line:</p>

<pre><code>{% for page, url in paginate.getPreviousUrls(5) %}
</code></pre>

<p>Should be:</p>

<pre><code>{% for page, url in paginate.getPrevUrls(5) %}
</code></pre>

CC BY-SA 4.0
2018-07-16T19:03:14.690Z
2018-07-16T19:42:28.367Z
2018-07-16T19:42:28.367Z
sonoflee
<p>I thought this would be easy.  I cut and pasted code that works from the Mijingo Happy Lager tutorial site. But, I keep getting the template error below.</p>

<p>My code...</p>

<pre><code>{% paginate craft.entries.section('posts').limit(8) as postEntries %}

    {% for post in postEntries %}

        &lt;div class="element-item {{post.isotope}} box col-md-3 "&gt;
            &lt;div class="post-box vertical clearfix"&gt;
                &lt;a href="{{ post.url }}" class="image-link arrow-icon dark-overlay"&gt;&lt;img src="{{ post.postImage.first().getUrl('thumbImage')}}" width="434" height="434" alt=""&gt;&lt;/a&gt;

                &lt;div class="extra-info"&gt;                                    
                    &lt;h5&gt;&lt;a href="{{ post.url }}"&gt;{{ post.title}}&lt;/a&gt;&lt;/h5&gt;

                    &lt;p class="meta small"&gt;{{ post.postDate | date('F d, Y') }}&lt;/p&gt;
                    &lt;a href="{{post.url}}" class="go-to-arrow"&gt;&lt;i class="fa fa-arrow-circle-o-right fa-2x" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;

                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    {% endfor %}

    &lt;div class="pagination"&gt;
        &lt;ul&gt;
            {% if paginate.prevUrl %}
                &lt;li&gt;&lt;a href="{{ paginate.prevUrl }}" class="pag-prev-link"&gt;Previous Page&lt;/a&gt;&lt;/li&gt;
            {% endif %}

            {% for page, url in paginate.getPreviousUrls(5) %}
                &lt;li&gt;&lt;a href="{{ url }}"&gt;{{ page }}&lt;/a&gt;&lt;/li&gt;
            {% endfor %}

            &lt;li class="current"&gt;{{ paginate.currentPage }}&lt;/li&gt;

            {% for page, url in paginate.getNextUrls(5) %}
                &lt;li&gt;&lt;a href="{{ url }}"&gt;{{ page }}&lt;/a&gt;&lt;/li&gt;
            {% endfor %}

            {% if paginate.nextUrl %}
                &lt;li&gt;&lt;a href="{{ paginate.nextUrl }}" class="pag-next-link"&gt;Next Page&lt;/a&gt;&lt;/li&gt;
            {% endif %}
        &lt;/ul&gt;
    &lt;/div&gt;

{% endpaginate %}   
</code></pre>

<p>The error message...</p>

<blockquote>
  <p>Neither the property "getPreviousUrls" nor one of the methods "getPreviousUrls()", "getgetPreviousUrls()"/"isgetPreviousUrls()" or "__call()" exist and have public access in class "Craft\PaginateVariable"</p>
</blockquote>

<p>What am I forgetting?</p>

<templating><pagination>
How do I get Pagination to Work?
# How do I get Pagination to Work?

(Asked by: username_0 on 2016-10-23)

I thought this would be easy.  I cut and pasted code that works from the Mijingo Happy Lager tutorial site. But, I keep getting the template error below.
My code...
{% paginate craft.entries.section('posts').limit(8) as postEntries %}

    {% for post in postEntries %}

        
            
                

                                                    
                    {{ post.title}}

                    {{ post.postDate | date('F d, Y') }}
                    

                
            
        
    {% endfor %}

    
        
            {% if paginate.prevUrl %}
                Previous Page
            {% endif %}

            {% for page, url in paginate.getPreviousUrls(5) %}
                {{ page }}
            {% endfor %}

            {{ paginate.currentPage }}

            {% for page, url in paginate.getNextUrls(5) %}
                {{ page }}
            {% endfor %}

            {% if paginate.nextUrl %}
                Next Page
            {% endif %}
        
    

{% endpaginate %}   

The error message...

Neither the property "getPreviousUrls" nor one of the methods "getPreviousUrls()", "getgetPreviousUrls()"/"isgetPreviousUrls()" or "__call()" exist and have public access in class "Craft\PaginateVariable"

What am I forgetting?

**Tags:** templating, pagination

---

## 2 answers

### Answer by username_1 on 2016-10-23. Score: 1 | Accepted answer

Not sure about the Mijingo tutorial, but pretty sure you need to change this:
{% paginate craft.entries.section('posts').limit(8) as postEntries %}

To this:
{% paginate craft.entries.section('posts').limit(8) as paginate, postEntries %}

If that doesn't work, then there is probably a conflict with your using paginate as a variable inside the {% paginate %} tag.
You should update it to be something else like the example in the pagination docs.

> **Comments:**
> **username_0**: It does not work.  
> **username_0**: But the pagination docs approach works.  Good enough for me.  

---

### Answer by username_2 on 2018-07-16. Score: 2

A couple of years later, I ran into the same issue. In case there are others looking, it looks like this line:
{% for page, url in paginate.getPreviousUrls(5) %}

Should be:
{% for page, url in paginate.getPrevUrls(5) %}


---

