I found this to be one of the cleanest solutions: http://djangosnippets.org/snippets/2421/
Just in case, when this link fades, here is the code:
CSS
ul.tab-menu li a { text-decoration: none; color: #000; } ul.tab-menu li.active a { color: #F00; }
menu.html
<ul class="tab-menu"> <li class="{% if active_tab == 'A' %}active{% endif %}"><a href="#">A</a></li> <li class="{% if active_tab == 'B' %}active{% endif %}"><a href="#">B</a></li> <li class="{% if active_tab == 'C' %}active{% endif %}"><a href="#">C</a></li> </ul>
page 'A
{% include "menu.html" with active_tab='A' %}
page 'B
{% include "menu.html" with active_tab='B' %}
page 'C
{% include "menu.html" with active_tab='C' %}
source share