<blockquote>
  <p>or would I have to pull all entries separately into an array?</p>
</blockquote>

<p>This one.</p>

<p>100% untested, but something like this should work:</p>

<pre><code>{% set ids = [] %}

{% set ids = ids|merge(craft.entries.section('events,opinionPieces,whitepapers').ids()) %}

{% set ids = ids|merge(craft.entries.section('checklists').level(1).ids()) %}

{% set entries = craft.entries.id(ids).find() %}
</code></pre>

CC BY-SA 3.0
2016-02-04T19:07:11.637Z
2016-02-05T07:40:41.303Z
2016-02-05T07:40:41.303Z
Brad Bell
<p>I'm trying to pull entries from multiple sections for a list on a page, which works fine:</p>

<pre><code>{% if section is not defined %}
    {% set section = 'events,checklists,opinionPieces,whitepapers' %}
{% endif %}

{% set params = {
    section: section
} %}
</code></pre>

<p>The problem I'm having is that the 'checklists' section is a structure with child entries allowed, and I only want the top level entries. I hoped I could get away with this:</p>

<pre><code>{% if section is not defined %}
    {% set section = 'events,checklists,opinionPieces,whitepapers' %}
{% endif %}

{% set params = {
    section: section,
    level: 1
} %}
</code></pre>

<p>But that then only returns checklists and whitepapers, presumably because they are structures and the other two are channels.</p>

<p>Is there an easy way of getting this to work, or would I have to pull all entries separately into an array?</p>

<entries><structure><channels>
Multiple sections, limiting the structure by depth
# Multiple sections, limiting the structure by depth

(Asked by: username_0 on 2016-02-04)

I'm trying to pull entries from multiple sections for a list on a page, which works fine:
{% if section is not defined %}
    {% set section = 'events,checklists,opinionPieces,whitepapers' %}
{% endif %}

{% set params = {
    section: section
} %}

The problem I'm having is that the 'checklists' section is a structure with child entries allowed, and I only want the top level entries. I hoped I could get away with this:
{% if section is not defined %}
    {% set section = 'events,checklists,opinionPieces,whitepapers' %}
{% endif %}

{% set params = {
    section: section,
    level: 1
} %}

But that then only returns checklists and whitepapers, presumably because they are structures and the other two are channels.
Is there an easy way of getting this to work, or would I have to pull all entries separately into an array?

**Tags:** entries, structure, channels


---

## 1 answers

### Answer by username_1 on 2016-02-04. Score: 2 | Accepted answer

or would I have to pull all entries separately into an array?

This one.
100% untested, but something like this should work:
{% set ids = [] %}

{% set ids = ids|merge(craft.entries.section('events,opinionPieces,whitepapers').ids()) %}

{% set ids = ids|merge(craft.entries.section('checklists').level(1).ids()) %}

{% set entries = craft.entries.id(ids).find() %}


---

