Skip to main content
Bumped by Community user
Bumped by Community user
added 6 characters in body; edited tags; edited title
Source Link
leymannx
  • 18.8k
  • 6
  • 72
  • 126

how to How can I pass the loop.index from a view template to a node template?

In a views template (views-view-unformatted.twig.html), I have

{% for row in rows %}  
    {% set row_index = loop.index0 %}  
    {{ row.content }}  
{% endfor %}  

where each row is processed in a node--view.twig.htmlnode--view.twig.html. How can I pass in row_indexrow_index to the node--view.twig.htmlnode--view.twig.html? This is used simply to create an index.

how to pass loop.index from view to node

In a views template (views-view-unformatted.twig.html), I have

{% for row in rows %}  
    {% set row_index = loop.index0 %}  
    {{ row.content }}  
{% endfor %}  

where each row is processed in a node--view.twig.html. How can I pass in row_index to the node--view.twig.html? This is used simply to create an index.

How can I pass the loop.index from a view template to a node template?

In a views template (views-view-unformatted.twig.html), I have

{% for row in rows %}  
    {% set row_index = loop.index0 %}  
    {{ row.content }}  
{% endfor %}  

where each row is processed in a node--view.twig.html. How can I pass in row_index to the node--view.twig.html? This is used simply to create an index.

Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Source Link

how to pass loop.index from view to node

In a views template (views-view-unformatted.twig.html), I have

{% for row in rows %}  
    {% set row_index = loop.index0 %}  
    {{ row.content }}  
{% endfor %}  

where each row is processed in a node--view.twig.html. How can I pass in row_index to the node--view.twig.html? This is used simply to create an index.