or try this: <div id="no_1"> {% for a in list|slice:"1" %} {{ something }} {% endfor %} </div>
<div id="no_2"> {% for a in list|slice:"1:3" %} {{ something }} {% endfor %} </div> <div id="no_3"> {% for a in list|slice:"3:" %} {{ something }} {% endfor %} </div> a little bit better i think 2006/11/14, Julio Nobrega <[EMAIL PROTECTED]>: > > Ugly, but I guess it works: > > {% for article in list %} > {% if forloop.first %} > <div>First</div> > {% else %} > {% ifequal forloop.counter 2 %} > <div>Second</div> > {% else %} > {% ifequal forloop.counter 3 %} > <div>Third</div> > {% else %} > <div>Rest goes here</div> > {% endifequal %} > {% endifequal %} > {% endif %} > {% endfor %} > > > On 11/14/06, Keith Mallory <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I am trying to get a list of articles displayed in different parts of a web > > page. The latest article in specific <div>, the next 2 in another <div> and > > rest of it somewhere down inside the same page. > > > > > > > > I am not able to figure out how? My guess is forloop, but how? > > > > > > Thanks > > > > Keith > > > > > > > > > > -- > Julio Nobrega - http://www.inerciasensorial.com.br > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---