On May 2, 7:28 am, "Chris O'Donnell" <[email protected]> wrote:
> I'm using the Blueprint CSS framework and need to be able to have
> every 6th list item processed with different code than every 1st-5th.
> I guess you could do some sort of "is divisible by 6" thing, but I'm
> not sure exactly what's entailed to get the job done. New to Django,
> if you haven't noticed. Any help will be greatly appreciated.
Well, you probably want the "divisibleby" filter...
{% for item in list %}
<li {% if forloop.counter|divisibleby:"6" %}lclass="different"{% endif
%}>{{ item }}</li>
{% endfor %}
--
DR.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---