<pre><code>{% set events = craft.entries.section('events').first() %} 
{% for event in events.children().status(null).find() %}
   {% for day in event.children().status(null).find() %}
      {% for session in day.children().status(null).find() %}
      {% endfor %}
   {% endfor %}
{% endfor %}
</code></pre>

<p><code>event.children()</code> does not return an array of elements but an object of type <code>ElementCriteriaModel</code> the same as <code>craft.entries</code> thus you can append whatever you want until you execute it with <code>find()</code> or <code>first()</code></p>

CC BY-SA 4.0
2018-05-25T17:27:16.303Z
2018-05-25T17:27:16.303Z
Robin Schambach
<p>I am building a plugin and in that plugin I am trying to grab all entries including disabled ones.  My structure is a single entry as the parent and then it will have multiple levels of children.  Currently I am grabbing the main parent with this code.</p>

<pre><code>{%   set events = craft.entries.section('events').first() %} 
</code></pre>

<p>Then I am doing nested for loops to work my way down such as the following.</p>

<pre><code>{% for event in events.children() %}
   {% for day in event.children %}
      {% for session in day.children() %}
      {% endfor %}
   {% endfor %}
{% endfor %}
</code></pre>

<p>This works just fine but the issue is it will not return the disabled entries.  I have noticed the status(null) when you are doing a find but I have not figured out a way to do it with the for loops.  I intend to keep the relationship structure in the ui so I am not looking to just get a random ordered list of all entries.</p>

<p>Any help would be appreciated and I am open if there is a more efficient solution.</p>

<plugin-development><templating><status>
Get all entries for a structure section including disabled
# Get all entries for a structure section including disabled

(Asked by: username_0 on 2018-05-25)

I am building a plugin and in that plugin I am trying to grab all entries including disabled ones.  My structure is a single entry as the parent and then it will have multiple levels of children.  Currently I am grabbing the main parent with this code.
{%   set events = craft.entries.section('events').first() %} 

Then I am doing nested for loops to work my way down such as the following.
{% for event in events.children() %}
   {% for day in event.children %}
      {% for session in day.children() %}
      {% endfor %}
   {% endfor %}
{% endfor %}

This works just fine but the issue is it will not return the disabled entries.  I have noticed the status(null) when you are doing a find but I have not figured out a way to do it with the for loops.  I intend to keep the relationship structure in the ui so I am not looking to just get a random ordered list of all entries.
Any help would be appreciated and I am open if there is a more efficient solution.

**Tags:** plugin-development, templating, status


---

## 1 answers

### Answer by username_1 on 2018-05-25. Score: 1 | Accepted answer

{% set events = craft.entries.section('events').first() %} 
{% for event in events.children().status(null).find() %}
   {% for day in event.children().status(null).find() %}
      {% for session in day.children().status(null).find() %}
      {% endfor %}
   {% endfor %}
{% endfor %}

event.children() does not return an array of elements but an object of type ElementCriteriaModel the same as craft.entries thus you can append whatever you want until you execute it with find() or first()


---

