<p>I don't know if there's a route way to handle this, but you could do a conditional on the <code>craft.request</code> method <a href="http://buildwithcraft.com/docs/templating/craft.request#getPageNum" rel="nofollow"><code>getPageNum()</code></a> like so:</p>

<pre><code>{% if craft.request.getPageNum == 1 %}
    &lt;!-- Header for the home page --&gt;
{% else %}
    &lt;!-- Header for pagination pages --&gt;
{% endif %}
</code></pre>

CC BY-SA 3.0
2014-08-14T04:42:24.840Z
Thanks for the suggestion! Although it feels a little hacky it does get the job done.
cballenar
CC BY-SA 3.0
2014-08-14T05:48:29.033Z
Why do you think it's hacky, because you use one template for both situations? What about using this template for this expression only and only use it to include two separate files?
carlcs
CC BY-SA 3.0
2014-08-14T05:49:07.217Z
@cballenar forgot the @ mention
carlcs
CC BY-SA 3.0
2014-08-14T14:26:40.780Z
I think it was because what I was trying to do was hacky. I'm currently rethinking the way the homepage is structured. I'm realizing that the homepage may not need "pagination" at all but just a link to the rest of articles. i.e.: example.com/articles/p#
cballenar
CC BY-SA 3.0
2014-08-14T14:29:12.180Z
P.S.: it erased the @ mention... I wonder if it does it automatically when replying to the last person that commented?
cballenar
CC BY-SA 3.0
2014-08-13T15:15:15.183Z
2014-08-13T15:15:15.183Z
carlcs
<p>Puzzle of the day: How does one load paginated entries on a different template?</p>

<p>Let's say in my homepage I'm loading the latest 5 entries and I would like to have pagination links below, however I want these to load on a different template. (in order to have less rings and bells than on the homepage)</p>

<p>I tried to use routes but it doesn't seem to be working, is this because the pagination works from the original template?</p>

<p>Here's what I tried for <strong>example.com</strong> where <strong>example.com/p2</strong> is paginated:</p>

<pre><code>'(?P&lt;page&gt;\d+)'     // page must be the answer, right?       nope...
'p(?P&lt;number&gt;\d+)'  // let's try combining 'p' and a number  nope...
'p\d+'              // how about with just the regex?        nope...
'(?P&lt;page&gt;)'        // also targets homepage so...           nope...
</code></pre>

<p>I also tried doing it in the CP with no results.</p>

<templating><pagination>
Use different template for paginated entries
# Use different template for paginated entries

(Asked by: username_0 on 2014-08-13)

Puzzle of the day: How does one load paginated entries on a different template?
Let's say in my homepage I'm loading the latest 5 entries and I would like to have pagination links below, however I want these to load on a different template. (in order to have less rings and bells than on the homepage)
I tried to use routes but it doesn't seem to be working, is this because the pagination works from the original template?
Here's what I tried for example.com where example.com/p2 is paginated:
'(?P\d+)'     // page must be the answer, right?       nope...
'p(?P\d+)'  // let's try combining 'p' and a number  nope...
'p\d+'              // how about with just the regex?        nope...
'(?P)'        // also targets homepage so...           nope...

I also tried doing it in the CP with no results.

**Tags:** templating, pagination

---

## 1 answers

### Answer by username_1 on 2014-08-13. Score: 5 | Accepted answer

I don't know if there's a route way to handle this, but you could do a conditional on the craft.request method getPageNum() like so:
{% if craft.request.getPageNum == 1 %}
    
{% else %}
    
{% endif %}

> **Comments:**
> **username_0**: Thanks for the suggestion! Although it feels a little hacky it does get the job done.  
> **username_1**: Why do you think it's hacky, because you use one template for both situations? What about using this template for this expression only and only use it to include two separate files?  
> **username_1**: @cballenar forgot the @ mention  
> **username_0**: I think it was because what I was trying to do was hacky. I'm currently rethinking the way the homepage is structured. I'm realizing that the homepage may not need "pagination" at all but just a link to the rest of articles. i.e.: example.com/articles/p#  
> **username_0**: P.S.: it erased the @ mention... I wonder if it does it automatically when replying to the last person that commented?  

---

