Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-13T17:56:42.127Z
Answers.LastActivityDate: 2015-11-13T17:56:42.127Z
Answers.UserDisplayName: a-am
Body: <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>
  
Tags: <pagination>
Title: Paginate entries with offset / limit when templating
ThreadText: # 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 %}
  <section class="two-col">
      <div class="firaslant"><h1>News</h1></div>
  
          {% for entry in paginatedEntries.limit(2) %}
              {# Show first 2 entries #}
          {% endfor %}    
      </section>
  
      <aside class="two-col-o">
          {% 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 %}
          <div class="searchbox">
              <h3>Search in News</h3>
              {% import "_macros/_search.twig" as searchForm %}
              {{ searchForm.simple('news') }}
          </div>
  
          {% import "_macros/_util.twig" as util %}
          {% if currentUser %}
              {{ util.link('/member-news', 'Browse Member News Articles') }}
          {% endif %}
  
      </aside>
  
      {# 6 entries as grid #}
      <div class="clear">
          {% for entry in paginatedEntries.offset(2) %}
                  {# Show next 6 articles #}
          {% endfor %}
      </div>
  
          {% if paginate.prevUrl %}<a href="{{ paginate.prevUrl }}" class="paginate-nav">Previous Page</a>{% endif %}
          {% if paginate.nextUrl %}<a href="{{ paginate.nextUrl }}" class="paginate-nav">Next Page</a>{% 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](http://twig.sensiolabs.org/doc/filters/slice.html) 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 %}
  
  ```
  
  
  ---
  
  