How to access outermost forloop.counter with nested for loops in Django templates?

You can use forloop.parentloop to get to the outer forloop, so in your case {{forloop.parentloop.counter}}.

Leave a Comment