<p>A <a href="https://craftcms.stackexchange.com/users/1021/jay">colleague of mine</a> shed some light on a very simple solution</p>

<pre><code>{% set myPages = craft.entries.section(['structureName', 'singleName']).order('sectionId desc') %}

&lt;nav&gt;
{% nav entry in myPages.level([1, null]) %}
  {{ entry.title }}
{% endnav %}
&lt;nav&gt;

&lt;aside&gt;
{% for entry in myPages.level(2) %}
  {{ entry.title }}
{% endfor %}
&lt;aside&gt;
</code></pre>

<p>Passing an array of handles/slugs instead of just a string works perfectly. Since singles don't have levels; defining <code>null</code> in the level pulls them out too. </p>

CC BY-SA 3.0
2016-10-12T15:57:24.077Z
2016-10-12T16:24:03.923Z
2017-04-13T12:51:00.200Z
Mark Notton
<p>So I have a structure with a few entries and a single. I want to list out the first level of the structure, plus the single. Then somewhere else, list out the second level. </p>

<p>I've tried the following:</p>

<pre><code>{% set myPages = craft.entries.section('structureName')|merge(craft.entries.section('singleName')) %}

&lt;nav&gt;
{% nav entry in myPages.level(1) %}
  {{ entry.title }}
{% endnav %}
&lt;nav&gt;

&lt;aside&gt;
{% for entry in myPages.level(2) %}
  {{ entry.title }}
{% endfor %}
&lt;aside&gt;
</code></pre>

<p>Which returns this error:</p>

<blockquote>
  <p>"Array to string conversion"</p>
</blockquote>

<p>When I remove the <code>.level(X)</code> function it will return all the entries, on all levels; including the single. </p>

<p>For the purposes of making my problem more understandable, I've simplified my above example. I know I could just add the single entry directly into the <code>&lt;nav&gt;</code>. But I'm curious about ways to add to a entries section object without losing the ability to query levels. </p>

<p>So, in the same way I can <a href="https://craftcms.stackexchange.com/a/1276/584">exclude entries</a>, is there a way to <strong>include</strong> an entry from a different section without relying on <a href="http://twig.sensiolabs.org/doc/filters/merge.html" rel="nofollow noreferrer">Twigs merge</a> filter?</p>

CC BY-SA 3.0
2016-10-12T15:39:36.140Z
Have you tried `level(1).first()`?
Simon Müller
<templating>
Include entries to a entries section object, without 'merge'
# Include entries to a entries section object, without 'merge'

(Asked by: username_0 on 2016-10-12)

So I have a structure with a few entries and a single. I want to list out the first level of the structure, plus the single. Then somewhere else, list out the second level. 
I've tried the following:
{% set myPages = craft.entries.section('structureName')|merge(craft.entries.section('singleName')) %}


{% nav entry in myPages.level(1) %}
  {{ entry.title }}
{% endnav %}



{% for entry in myPages.level(2) %}
  {{ entry.title }}
{% endfor %}


Which returns this error:

"Array to string conversion"

When I remove the .level(X) function it will return all the entries, on all levels; including the single. 
For the purposes of making my problem more understandable, I've simplified my above example. I know I could just add the single entry directly into the . But I'm curious about ways to add to a entries section object without losing the ability to query levels. 
So, in the same way I can exclude entries, is there a way to include an entry from a different section without relying on Twigs merge filter?

**Tags:** templating

> **Comments:**
> **username_1**: Have you tried `level(1).first()`?  

---

## 1 answers

### Answer by username_0 on 2016-10-12. Score: 1 | Accepted answer

A colleague of mine shed some light on a very simple solution
{% set myPages = craft.entries.section(['structureName', 'singleName']).order('sectionId desc') %}


{% nav entry in myPages.level([1, null]) %}
  {{ entry.title }}
{% endnav %}



{% for entry in myPages.level(2) %}
  {{ entry.title }}
{% endfor %}


Passing an array of handles/slugs instead of just a string works perfectly. Since singles don't have levels; defining null in the level pulls them out too.


---

