<p>Something like this should work:</p>

<pre><code>{% 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 %}
</code></pre>

CC BY-SA 3.0
2015-11-12T19:04:16.183Z
2015-11-12T19:04:16.183Z
Brad Bell
<p>I would like to selectively show a subset of my sections in the main navigation. Is it possible to do something like this?</p>

<pre><code>{% set sections = craft.sections.getSectionById(1,2,3) %}

{% for section in sections}
...
</code></pre>

<templating><sections>
Show a partial list of sections
# Show a partial list of sections

(Asked by: username_0 on 2015-11-12)

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}
...

**Tags:** templating, sections

---

## 1 answers

### Answer by username_1 on 2015-11-12. Score: 1 | Accepted answer

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 %}


---

