I want the effect of an "ifgt" template tag in a django template page:
{%ifgt forloop.counter 10%}<!---special greater than 10 code--!>{%endif%}
I want the effect of an "ifgt" template tag in a django template page:
{%ifgt forloop.counter 10%}<!---special greater than 10 code--!>{%endif%}
This Django snippet will give you a smart if tag that you can use with operators such as greater than: http://www.djangosnippets.org/snippets/1350/
If you only need greater-than, you can use the following easy snippet (put it into app/templatetags/greaterthan.py):
from django import template
register = template.Library()
@register.filter
def gt(a, b):
return a > b
And in a template:
{% load greterthan %}
{% if forloop.counter|gt:10 %}...{% endif %}