<p>Pagination query/issue. </p>

<p>The client/design for a site am building requires the first page to show fewer entries than subsequent pages so been guessing have to write some own/custom pagination jiggery pokery.</p>

<p>If I dynamically apply the values I want to pass into my <code>{% paginate %}</code> tag it's not working as expected. Any thoughts why?</p>

<p>To provide an example, I have a section with 20 entries in it. The first page should return 5 entries but subsequent pages should show 12.</p>

<p>So on page one I set a limit of <code>5</code> and an offset of <code>0</code>, eg <code>{% paginate list.offset(p).limit(l) as info, entries %}</code> - where <code>list</code> is my entries, <code>p</code> is 0 and <code>l</code> is 5 - and this works as expected.</p>

<p>However, for subsequent pages, eg for page 2 where <code>p</code> is 5 and <code>l</code> is 12` (offset of 5 and a limit of 12)  am only getting 3 entries on the page.</p>

<p>Any suggestions? Do I just need to roll my pagination using <code>{% craft.entries %}</code> instead? (edited)</p>

<p>think will have to bypass native pagination entirely. If I dump out the info from my pagination query I get </p>

<pre><code>'first' =&gt; 18
'last' =&gt; 15
'total' =&gt; 15
'currentPage' =&gt; 2
'totalPages' =&gt; 2
</code></pre>

<p>Is there a simpler way of rolling this out rather than some custom work?</p>

CC BY-SA 3.0
2017-11-30T10:49:58.557Z
I may be reading this wrong but your dump indicates you have 15 entries in total and not 20? Are some disabled or in some way excluded from your query?.
foamcow
CC BY-SA 3.0
2017-11-30T10:51:40.080Z
Wait... Page 0 shows 5, Page 1 shows 12, Page 2 shows 3. So that's 5+12+3 = 20.
foamcow
<pagination>
Pagination query
# Pagination query

(Asked by: username_0 on 2017-11-30)

Pagination query/issue. 
The client/design for a site am building requires the first page to show fewer entries than subsequent pages so been guessing have to write some own/custom pagination jiggery pokery.
If I dynamically apply the values I want to pass into my {% paginate %} tag it's not working as expected. Any thoughts why?
To provide an example, I have a section with 20 entries in it. The first page should return 5 entries but subsequent pages should show 12.
So on page one I set a limit of 5 and an offset of 0, eg {% paginate list.offset(p).limit(l) as info, entries %} - where list is my entries, p is 0 and l is 5 - and this works as expected.
However, for subsequent pages, eg for page 2 where p is 5 and l is 12` (offset of 5 and a limit of 12)  am only getting 3 entries on the page.
Any suggestions? Do I just need to roll my pagination using {% craft.entries %} instead? (edited)
think will have to bypass native pagination entirely. If I dump out the info from my pagination query I get 
'first' => 18
'last' => 15
'total' => 15
'currentPage' => 2
'totalPages' => 2

Is there a simpler way of rolling this out rather than some custom work?

**Tags:** pagination

> **Comments:**
> **username_1**: I may be reading this wrong but your dump indicates you have 15 entries in total and not 20? Are some disabled or in some way excluded from your query?.  
> **username_1**: Wait... Page 0 shows 5, Page 1 shows 12, Page 2 shows 3. So that's 5+12+3 = 20.  

---

## 0 answers

