1

I have an entry that has a entries field where 9 entries have been added.

The first three entries are displayed in one block at the top of the page and this works correctly using .limit(3)

However further down the page I expect 6 entries to be displayed when using .offset(3). That is not happening. Instead you only see the next 3 entries, not the next 6. If I change to offset(6) I still see 3 entries but it's the final three entries.

Below is simplified relevant code.

{% for secondaryEntry in entry.secondaryFeatures.offset(3).all() %}  
  <li class="col-sm-4 feat-box">
    <div class="content">
      <a href="{{ secondaryEntry.url }}" class="img-container">
        {{ secondaryEntry.title }}
      </a>
    </div>
  </li>
{% endfor %}

Please advise.

edit Here is the code calling the first three entries at the top of the page

{% for secondaryEntry in entry.secondaryFeatures.limit(3).all() %}
  <li class="col-sm-4 feat-box">
      more code
  </li>
{% endfor %}
  • Can you edit the question and show how you're pulling in and displaying the first 3 entries? – Brad Bell May 14 at 22:41
  • @BradBell Have added in the code you requested – CreateSean May 15 at 12:58
1

You will need to reset your .limit(null) on the second call (the one with your offset) due to the way Element Queries work.

  • Thank you, that fixed it. – CreateSean May 15 at 20:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.