<p>You could use Twig's <a href="http://twig.sensiolabs.org/doc/filters/slice.html" rel="noreferrer">Slice</a> function. </p>

<pre><code>{% set firstTwo = paginatedEntries|slice(0,2) %}
{% set lastFour = paginatedEntries|slice(2,4) %}
</code></pre>

<p>Then loop over <code>firstTwo</code> for your first items. </p>

<pre><code>{% for entry in firtTwo %}
   {# Show first 2 entries #}
{% endfor %} 
</code></pre>

<p>Loop over <code>lastFour</code> for your final items.</p>

<pre><code>{% for entry in lastFour %}
   {# Show next 6 articles #}
{% endfor %}
</code></pre>

CC BY-SA 3.0
2015-11-13T17:56:42.127Z
2015-11-13T17:56:42.127Z
a-am
<p>I've got the pagination function working nicely for a simple for loop of news entries. However I want to split the template up into the first 2 entries as featured items then the next 6 as smaller items. As I paginate through the entries I'd like to keep that layout, however it seems that I cannot use paginatedEntries.limit(2) or paginatedEntries.limit(6).offset(2). Is there another way of doing this?</p>

<pre><code>{% paginate craft.entries.section('news').limit(8) as paginatedEntries %}
&lt;section class="two-col"&gt;
    &lt;div class="firaslant"&gt;&lt;h1&gt;News&lt;/h1&gt;&lt;/div&gt;

        {% for entry in paginatedEntries.limit(2) %}
            {# Show first 2 entries #}
        {% endfor %}    
    &lt;/section&gt;

    &lt;aside class="two-col-o"&gt;
        {% set tagentries = craft.entries.section('news').limit(null) %}
        {% if craft.tags.relatedTo(tagentries)|length %}
            {% import "_macros/_news.twig" as news %}
            {{ news.tags(tagentries, 'News', 'news') }}
        {% endif %}
        &lt;div class="searchbox"&gt;
            &lt;h3&gt;Search in News&lt;/h3&gt;
            {% import "_macros/_search.twig" as searchForm %}
            {{ searchForm.simple('news') }}
        &lt;/div&gt;

        {% import "_macros/_util.twig" as util %}
        {% if currentUser %}
            {{ util.link('/member-news', 'Browse Member News Articles') }}
        {% endif %}

    &lt;/aside&gt;

    {# 6 entries as grid #}
    &lt;div class="clear"&gt;
        {% for entry in paginatedEntries.offset(2) %}
                {# Show next 6 articles #}
        {% endfor %}
    &lt;/div&gt;


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

<p>As soon as I remove .offset(2) or .limit(2) the code functions correctly without errors.</p>

<pagination>
Paginate entries with offset / limit when templating
# Paginate entries with offset / limit when templating

(Asked by: username_0 on 2015-11-13)

I've got the pagination function working nicely for a simple for loop of news entries. However I want to split the template up into the first 2 entries as featured items then the next 6 as smaller items. As I paginate through the entries I'd like to keep that layout, however it seems that I cannot use paginatedEntries.limit(2) or paginatedEntries.limit(6).offset(2). Is there another way of doing this?
{% paginate craft.entries.section('news').limit(8) as paginatedEntries %}

    News

        {% for entry in paginatedEntries.limit(2) %}
            {# Show first 2 entries #}
        {% endfor %}    
    

    
        {% set tagentries = craft.entries.section('news').limit(null) %}
        {% if craft.tags.relatedTo(tagentries)|length %}
            {% import "_macros/_news.twig" as news %}
            {{ news.tags(tagentries, 'News', 'news') }}
        {% endif %}
        
            Search in News
            {% import "_macros/_search.twig" as searchForm %}
            {{ searchForm.simple('news') }}
        

        {% import "_macros/_util.twig" as util %}
        {% if currentUser %}
            {{ util.link('/member-news', 'Browse Member News Articles') }}
        {% endif %}

    

    {# 6 entries as grid #}
    
        {% for entry in paginatedEntries.offset(2) %}
                {# Show next 6 articles #}
        {% endfor %}
    


        {% if paginate.prevUrl %}Previous Page{% endif %}
        {% if paginate.nextUrl %}Next Page{% endif %}
{% endpaginate %}

As soon as I remove .offset(2) or .limit(2) the code functions correctly without errors.

**Tags:** pagination

---

## 1 answers

### Answer by username_1 on 2015-11-13. Score: 6 | Accepted answer

You could use Twig's Slice function. 
{% set firstTwo = paginatedEntries|slice(0,2) %}
{% set lastFour = paginatedEntries|slice(2,4) %}

Then loop over firstTwo for your first items. 
{% for entry in firtTwo %}
   {# Show first 2 entries #}
{% endfor %} 

Loop over lastFour for your final items.
{% for entry in lastFour %}
   {# Show next 6 articles #}
{% endfor %}


---

