1

I have an entries field in a section, I am looking to output a certain selected entry from this field based on its position.

For example I want to out the 2nd or 3rd entry only from this entry field, what is the best way to do this without calling all the entries and looping through them all?

3
{% set allEntries = entry.entriesSelector.all() %}

<ul>
    <li>First: {{ allEntries[0].title }}</li>
    <li>Second: {{ allEntries[1].title }}</li>
    <li>Fourth: {{ allEntries[3].title }}</li>
    <li>Last: {{ allEntries|reverse[0].title }}</li>
</ul>

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.