I want to build a subnav with all entries from the current Section.

{% set pages = craft.entries.section(getCurrentSection).level(1) %}

I'm looking for the handle "getCurrentSection". I will use this for pages in 5 different sections, so I don't want to select the section by hand, like:

{% set pages = craft.entries.section('Section 1').level(1) %}
{% set pages = craft.entries.section('Section 2').level(1) %}

1 Answer 1


You can get the current section handle from the entry like so

{{ entry.section.handle }}
  • No problems, glad it did the trick ;)
    – Fyrebase
    Aug 31, 2016 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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