Answers.Body: <p>When you're setting <code>section.links.limit(4)</code>, Craft will persist that limit in subsequent calls.</p>
  <p>This was a change introduced in Craft 3, which you can read about <a href="https://docs.craftcms.com/v3/changes-in-craft-3.html#cloning-element-queries" rel="nofollow noreferrer">Changes in Craft 3 | Cloning Element Queries</a></p>
  <hr />
  <p>You have two options to resolve your issue:</p>
  <p>Use <code>clone()</code> to create a new version of the <code>ElementCriteriaModel</code> for each time you use <code>section.links</code></p>
  <pre><code>{% for mainLink in clone(section.links).limit(4).all() %}
  {% endfor %}
  
  {% for secondaryLink in clone(section.links).offset(4).all() %}
  {% endfor %}
  </code></pre>
  <p>Or unset the limit your limit in the second for loop</p>
  <pre><code>{% for mainLink in section.links.limit(4).all() %}
  {% endfor %}
  
  {% for secondaryLink in section.links.limit(null).offset(4).all() %}
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-01T10:31:35.690Z
Answers.LastActivityDate: 2020-07-01T10:31:35.690Z
Answers.UserDisplayName: Joshua M
Answers.Body: <p>Joshua M's answer explains why it's happening, but in terms of best practice, you'd be better off avoiding multiple roundtrips to the database by using Twig filters on a single result set. There are probably a few different ways, but here's one using <code>slice</code>:</p>
  <pre><code>{% set allLinks = section.links.all() %}
  
  {% for link in allLinks|slice(0, 3) %}
      {# iterate through the first 4 items #}
  {% endfor %}
  
  {% for link in allLinks|slice(3) %}
      {# iterate from the 4th item to the last #}
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-01T16:22:43.323Z
Answers.LastActivityDate: 2020-07-01T16:22:43.323Z
Answers.UserDisplayName: James Smith
Body: <p>If have this in a template:</p>
  <pre><code>{% for mainLink in section.links.limit(4).all() %}
  {% endfor %}
  
  {% for secondaryLink in section.links.offset(4).all() %}
  {% endfor %}
  </code></pre>
  <p>Which I thought would show the first four in the first list and however many from 5 onwards in the secondary list. But what's happening is that the second list is limiting the output to 4 as well. Why is that?</p>
  
Tags: <entries><query><limit>
Title: Offset setting a limit?
ThreadText: # Offset setting a limit?
  
  (Asked by: username_0 on 2020-07-01)
  
  If have this in a template:
  
  ```
  {% for mainLink in section.links.limit(4).all() %}
  {% endfor %}
  
  {% for secondaryLink in section.links.offset(4).all() %}
  {% endfor %}
  
  ```
  
  Which I thought would show the first four in the first list and however many from 5 onwards in the secondary list. But what's happening is that the second list is limiting the output to 4 as well. Why is that?
  
  **Tags:** entries, query, limit
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-07-01. Score: 3 | Accepted answer
  
  When you're setting `section.links.limit(4)`, Craft will persist that limit in subsequent calls.
  
  This was a change introduced in Craft 3, which you can read about [Changes in Craft 3 | Cloning Element Queries](https://docs.craftcms.com/v3/changes-in-craft-3.html#cloning-element-queries)
  
  ---
  
  You have two options to resolve your issue:
  
  Use `clone()` to create a new version of the `ElementCriteriaModel` for each time you use `section.links`
  
  ```
  {% for mainLink in clone(section.links).limit(4).all() %}
  {% endfor %}
  
  {% for secondaryLink in clone(section.links).offset(4).all() %}
  {% endfor %}
  
  ```
  
  Or unset the limit your limit in the second for loop
  
  ```
  {% for mainLink in section.links.limit(4).all() %}
  {% endfor %}
  
  {% for secondaryLink in section.links.limit(null).offset(4).all() %}
  {% endfor %}
  
  ```
  
  
  ---
  
  ### Answer by username_2 on 2020-07-01. Score: 3
  
  username_1's answer explains why it's happening, but in terms of best practice, you'd be better off avoiding multiple roundtrips to the database by using Twig filters on a single result set. There are probably a few different ways, but here's one using `slice`:
  
  ```
  {% set allLinks = section.links.all() %}
  
  {% for link in allLinks|slice(0, 3) %}
      {# iterate through the first 4 items #}
  {% endfor %}
  
  {% for link in allLinks|slice(3) %}
      {# iterate from the 4th item to the last #}
  {% endfor %}
  
  ```
  
  
  ---
  
  