I think, it's impossible to use forloop.counter0 as an index, because array.forloop already searches for array['forloop'], array[forloop], array.forloop, and similar combinations which don't exist. But maybe you could zip(items, array) in the view or merge items and array in some other way and to get all the necessary values from that merged list.
Good luck! Aidas Bendoraitis aka Archatas On 2/1/07, Brandon Warren <[EMAIL PROTECTED]> wrote: > > Hello, > > Is it possible to use forloop.counter0 as an index into a list? > > For example: > > in my view I have: > > array=[10,11,12,13] > > in my template I have: > > {% for item in items %} > counter = {{ forloop.counter0 }}<BR> > 1st val of array = {{ array.0 }}<BR> > nothing appears here: {{array.forloop.counter0 }}<BR> > ---------------<BR> > {% endfor %} > > This is what comes out the browser: > counter = 0 > 1st val of array = 10 > nothing appears here: > --------------- > counter = 1 > 1st val of array = 10 > nothing appears here: > --------------- > > Thanks in advance, > Brandon > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---