I want to display the current entry's index - like in this post Get entry index.
However my entries are in a structure section type not a channel, so they are not ordered by date.
Is is possible to edit the solution (below) from the above post so that it is not sorting the entries by date but rather retaining the custom order of the structure?
{# Get this entry + all entries posted before it #}
{% set postDateParam = '<= ' ~ entry.postDate|date('c') %}
{% set entryIds = craft.entries.section('news')
.order('postDate asc').postDate(postDateParam).ids() %}
{# Count them #}
{% set position = entryIds|length %}
{{ position }}