If I’m looping through a collection of modular pages, how can I access the index of the child page in the collection array from the modular template?
The loop in page.html.twig
{% for childpage in page.children %}
{{ childpage.content }}
{% endfor %}
And the childpage modular template in modular/childpage.html.twig
:
{{ content }}
<!-- this is where I need the current index in the collection array -->
I know without context of the markup around the modular template it seems redundant, but I just needed to establish the bare-bones setup.