thanks Is there a way for me to achieve what I'm looking for?
In my case I want to place an adsense ad between a couple of blog posts though want to make sure that I don't go over the 3 ads per page limit. On 12/15/05, kmh <[EMAIL PROTECTED]> wrote: > > Milton Waddams wrote: > > Can someone tell me why this doesn't work? > > > > {% ifequal forloop.counter0 1 %} > > > > there are enough loops and the output of {{forloop.counter0}} does > > print 1 at the appropriate place? > > > > By work I mean it is never equal, I've tried putting the 1 in quotes > > with no difference. > > Two problems: > > The "if" style tags add these variables to the context stack inside the > loop. The variables are not present in the context at the time the > "if" tag is interpreted. > > However, even if they were, variables are not automatically > interpolated inside tags. Some tags like {% extends %} do allow > variables as arguments, but in these cases the tag has been explicitly > coded to interpolate variable arguments - you can't assume this > behaviour. > > Kieran > >