2

I would like to selectively show a subset of my sections in the main navigation. Is it possible to do something like this?

{% set sections = craft.sections.getSectionById(1,2,3) %}

{% for section in sections}
...
1

Something like this should work:

{% set sections = [] %}

{% set sections = sections|merge([craft.sections.getSectionById(1)])
{% set sections = sections|merge([craft.sections.getSectionById(2)])
{% set sections = sections|merge([craft.sections.getSectionById(3)])

{% for section in sections %}
    ...
{% endfor %}

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.