Overview

Save this as smart_if.py in the templatetags folder of one of your apps. Then a simple {% load smartif %} replaces the boring built-in Django {% if %} template with the new smart one.

http://www.djangosnippets.org/snippets/1350/