<p>Building upon the answer I posted to this question <a href="https://craftcms.stackexchange.com/questions/13214/how-to-get-the-order-number-of-the-current-entry-in-a-structure">How to get the order number of the current entry in a structure</a>, you should be able to get the order number in your for-loop like so:</p>

<pre><code>{% set parent = entry.getParent() %}
{% set childrenIds = parent.getChildren().ids() %}

{% for sibling in entry.getSiblings() %}
    {% set orderNumber = craft.entries({
        id: siblingsIds,
        order: 'lft desc',
        positionedBefore: sibling,
    }).total() + 1 %}

    {{ sibling.title }} ({{ orderNumber }})
{% endfor %}
</code></pre>

CC BY-SA 3.0
2017-01-19T23:44:40.647Z
2017-01-19T23:44:40.647Z
2017-04-13T12:51:00.160Z
carlcs
<p>This question is related to this <a href="https://craftcms.stackexchange.com/questions/17707/display-childrens-order-numbers">thread</a>.</p>

<pre><code>{% for sibling in entry.getSiblings() %}  
{{ sibling.title }} {{ sibling.orderNumber }}
{% endfor %}
</code></pre>

<p>I thought you could pick this out of the ElementCriteriaModel, but that doesn't seem to be possible/available. Twig's for loop won't work either.</p>

<p>The result I am looking for is to echo the order number of the siblings in a <strong>structure</strong>. </p>

<pre><code>Parent
Child order number 1
Child order number 2
Child order number 3
</code></pre>

<structure>
How do I output the siblings position number?
# How do I output the siblings position number?

(Asked by: username_0 on 2017-01-19)

This question is related to this thread.
{% for sibling in entry.getSiblings() %}  
{{ sibling.title }} {{ sibling.orderNumber }}
{% endfor %}

I thought you could pick this out of the ElementCriteriaModel, but that doesn't seem to be possible/available. Twig's for loop won't work either.
The result I am looking for is to echo the order number of the siblings in a structure. 
Parent
Child order number 1
Child order number 2
Child order number 3

**Tags:** structure


---

## 1 answers

### Answer by username_1 on 2017-01-19. Score: 1 | Accepted answer

Building upon the answer I posted to this question How to get the order number of the current entry in a structure, you should be able to get the order number in your for-loop like so:
{% set parent = entry.getParent() %}
{% set childrenIds = parent.getChildren().ids() %}

{% for sibling in entry.getSiblings() %}
    {% set orderNumber = craft.entries({
        id: siblingsIds,
        order: 'lft desc',
        positionedBefore: sibling,
    }).total() + 1 %}

    {{ sibling.title }} ({{ orderNumber }})
{% endfor %}


---

