<p>No – whatever you've currently set as the sorting order (Structure, Post Date, Expiry Date, etc) in the <a href="https://pixelandtonic.com/content/blog/2015-11/customized-entry-index.jpg" rel="nofollow">element index</a> in the control panel <strong>has absolutely no effect</strong> on how your entries are output in a template, or how they're ordered.</p>

<p>For Structure sections, the default sorting order in a template is <em>Structure</em>, i.e. hierarchical:</p>

<pre><code>{% for entry in craft.entries.section('myStructureSection') %}
    {# Will output entries in hierarchical, chronological order #}
{% endfor %}
</code></pre>

<p>Keep in mind that if your Structure has multiple levels, i.e. child entries, you'll have to jump through a few hoops – using the <a href="https://craftcms.com/docs/templating/nav" rel="nofollow"><code>{% nav %}</code></a> tag is recommended as its able to output child entries recursively, e.g:</p>

<pre><code>{% nav entry in entries %}
    &lt;li&gt;
        &lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;
        {% ifchildren %}
            &lt;ul&gt;
                {% children %}
            &lt;/ul&gt;
        {% endifchildren %}
    &lt;/li&gt;
{% endnav %}
</code></pre>

<p>Finally, if you want to output the entries in a non-hierarchical order, you can use the <a href="https://craftcms.com/docs/templating/craft.entries#order" rel="nofollow"><code>order</code></a> parameter:</p>

<pre><code>{% for entry in craft.entries.section('myStructureSection').order('postDate desc') %}
    {# Will output newest first #}
{% endfor %}
</code></pre>

CC BY-SA 3.0
2016-06-17T11:20:57.820Z
2016-06-17T11:20:57.820Z
Mats Mikkel Rummelhoff
<p>i am new to craft.
Is there a connection between the control panel sorting setting for structure entries and the template output.</p>

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

<p>Changing sort method in control panel should leads to different outputs in template. Is that right?</p>

<p>Goal is to output entries in sort order related to control panel sort settings.</p>

<p>What did i do wrong?</p>

<templating><control-panel>
Control Panel, sorting issue
# Control Panel, sorting issue

(Asked by: username_0 on 2016-06-17)

i am new to craft.
Is there a connection between the control panel sorting setting for structure entries and the template output.
{% set entries = craft.entries.section('projects') %}

Changing sort method in control panel should leads to different outputs in template. Is that right?
Goal is to output entries in sort order related to control panel sort settings.
What did i do wrong?

**Tags:** templating, control-panel

---

## 1 answers

### Answer by username_1 on 2016-06-17. Score: 2

No – whatever you've currently set as the sorting order (Structure, Post Date, Expiry Date, etc) in the element index in the control panel has absolutely no effect on how your entries are output in a template, or how they're ordered.
For Structure sections, the default sorting order in a template is Structure, i.e. hierarchical:
{% for entry in craft.entries.section('myStructureSection') %}
    {# Will output entries in hierarchical, chronological order #}
{% endfor %}

Keep in mind that if your Structure has multiple levels, i.e. child entries, you'll have to jump through a few hoops – using the {% nav %} tag is recommended as its able to output child entries recursively, e.g:
{% nav entry in entries %}
    
        {{ entry.title }}
        {% ifchildren %}
            
                {% children %}
            
        {% endifchildren %}
    
{% endnav %}

Finally, if you want to output the entries in a non-hierarchical order, you can use the order parameter:
{% for entry in craft.entries.section('myStructureSection').order('postDate desc') %}
    {# Will output newest first #}
{% endfor %}


---

