1

Suppose I have a structure Section with Entries like this:

  • Parent A
    • Child X
  • Parent B
  • Parent C
    • Child Y

How would I return this list of Entries?

[Parent A, Parent B, Parent C]
2

You can use the level() parameter (docs) on your query:

{% set entries = craft.entries()
    .section('yourSectionHandle')
    .level(1)
    .all() %}
1
  • Thank you so much @Oli. I really appreciate your help. Thank you again.
    – sam
    Sep 16 at 6:30

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.