Answers.Body: <p>The above doesn't display any paging even when there is paging. It needs to be pageInfo not paginate:</p>
  
  <pre><code>{% if pageInfo.totalPages &gt; 1 %}
  
      {# output current pages and pagination navigation here #}
  
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-23T15:36:29.420Z
Answers.Text: Nicole: The [craft docs](https://craftcms.com/docs/templating/paginate) use ``pageInfo`` in the example but if you don't specify, [``paginate``](https://craftcms.com/docs/templating/paginate#the-pageInfo-variable) is used by default.
Answers.UserDisplayName: RitterKnight
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-23T06:37:49.147Z
Answers.LastActivityDate: 2016-02-23T06:37:49.147Z
Answers.UserDisplayName: Nicole Lambon
Answers.Body: <p>The <code>paginate.totalPages</code> variable will give you the total number of pages that are generated by the <code>paginate</code> tag. So you can wrap your display of pages around a conditional that checks to see if this is greater than 1.</p>
  
  <pre><code>{% if paginate.totalPages &gt; 1 %}
  
      {# output current pages and pagination navigation here #}
  
  {% endif %}
  </code></pre>
  
  <p>More details, including a full list of variables available, can be found in the <a href="https://craftcms.com/docs/templating/paginate">pagination docs</a>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-18T13:01:19.483Z
Answers.LastActivityDate: 2015-12-18T13:01:19.483Z
Answers.UserDisplayName: Steve Rowling
Body: <p>Below is my paginate code.
  How can I check if there is more than one page? At the moment when there is only one I'm getting a '1' appear at the bottom (the page number) which looks odd. Ideally I only want it to show the pagination if the number of entries exceeds the limit, so only if it needs to display a link to the next page.</p>
  
  <pre><code>{% paginate craft.entries.section('insights').limit(1) as entriesOnPage %}
      {% for entry in entriesOnPage %}
      &lt;article&gt;
          {% for image in entry.blogImage %}
          &lt;img src="{{ image.getUrl()}}" alt="{{ image.title }}" class="gutter-bottom--half"/&gt;
          {% endfor %}
          &lt;h3&gt;&lt;a class="descrete-link" href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/h3&gt;
          {{ entry.body|hacksaw(chars='300', append='...') }}
          &lt;br&gt;
          &lt;br&gt;            
          &lt;p&gt;&lt;a class="button button--blue gutter-bottom--half" href="{{ entry.url }}"&gt;Continue reading&lt;/a&gt;&lt;/p&gt;
          &lt;div class="col-12-nf gutter-bottom"&gt;
              &lt;hr&gt;
          &lt;/div&gt;
      &lt;/article&gt;
      &lt;br&gt;
  {% endfor %}
  
  {% if paginate.prevUrl %}&lt;a href="{{ paginate.prevUrl }}"&gt;Previous&lt;/a&gt;{% endif %}
  
  {% for page, url in paginate.getPrevUrls(5) %}
      &lt;a href="{{ url }}"&gt;{{ page }}&lt;/a&gt;
  {% endfor %}
  
  &lt;span class="current"&gt;{{ paginate.currentPage }}&lt;/span&gt;
  
  
  {% for page, url in paginate.getNextUrls(5) %}
      &lt;a href="{{ url }}"&gt;{{ page }}&lt;/a&gt;
  {% endfor %}
  
  {% if paginate.nextUrl %}&lt;a href="{{ paginate.nextUrl }}"&gt;Next&lt;/a&gt;{% endif %}
  
  
  {% endpaginate %}
  </code></pre>
  
Tags: <pagination><limit>
Title: Check if paginate
ThreadText: # Check if paginate
  
  (Asked by: username_0 on 2015-12-18)
  
  Below is my paginate code.
  How can I check if there is more than one page? At the moment when there is only one I'm getting a '1' appear at the bottom (the page number) which looks odd. Ideally I only want it to show the pagination if the number of entries exceeds the limit, so only if it needs to display a link to the next page.
  
  ```
  {% paginate craft.entries.section('insights').limit(1) as entriesOnPage %}
      {% for entry in entriesOnPage %}
      <article>
          {% for image in entry.blogImage %}
          <img src="{{ image.getUrl()}}" alt="{{ image.title }}" class="gutter-bottom--half"/>
          {% endfor %}
          <h3><a class="descrete-link" href="{{ entry.url }}">{{ entry.title }}</a></h3>
          {{ entry.body|hacksaw(chars='300', append='...') }}
          <br>
          <br>            
          <p><a class="button button--blue gutter-bottom--half" href="{{ entry.url }}">Continue reading</a></p>
          <div class="col-12-nf gutter-bottom">
              <hr>
          </div>
      </article>
      <br>
  {% endfor %}
  
  {% if paginate.prevUrl %}<a href="{{ paginate.prevUrl }}">Previous</a>{% endif %}
  
  {% for page, url in paginate.getPrevUrls(5) %}
      <a href="{{ url }}">{{ page }}</a>
  {% endfor %}
  
  <span class="current">{{ paginate.currentPage }}</span>
  
  {% for page, url in paginate.getNextUrls(5) %}
      <a href="{{ url }}">{{ page }}</a>
  {% endfor %}
  
  {% if paginate.nextUrl %}<a href="{{ paginate.nextUrl }}">Next</a>{% endif %}
  
  {% endpaginate %}
  
  ```
  
  **Tags:** pagination, limit
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2015-12-18. Score: 9 | Accepted answer
  
  The `paginate.totalPages` variable will give you the total number of pages that are generated by the `paginate` tag. So you can wrap your display of pages around a conditional that checks to see if this is greater than 1.
  
  ```
  {% if paginate.totalPages > 1 %}
  
      {# output current pages and pagination navigation here #}
  
  {% endif %}
  
  ```
  
  More details, including a full list of variables available, can be found in the [pagination docs](https://craftcms.com/docs/templating/paginate).
  
  
  ---
  
  ### Answer by username_1 on 2016-02-23. Score: 2
  
  The above doesn't display any paging even when there is paging. It needs to be pageInfo not paginate:
  
  ```
  {% if pageInfo.totalPages > 1 %}
  
      {# output current pages and pagination navigation here #}
  
  {% endif %}
  
  ```
  
  > **Comments:**
  > **username_2**: username_1: The [craft docs](https://craftcms.com/docs/templating/paginate) use ``pageInfo`` in the example but if you don't specify, [``paginate``](https://craftcms.com/docs/templating/paginate#the-pageInfo-variable) is used by default.  
  
  ---
  
  