I have a parent template that contains a generic navigation menu. I want to be able to add class="selected"
to the appropriate menu option.
I want to be able to set a variable in a child template, for example:
{% set menu = "products" %}
and do:
{%ifequal menu "products" %}class="selected"{% endifequal %}
I don't want to set a value in the View because I would have to add this to all my view methods, and I dont want to repeat the entire menu html in each child page because if the menu changes I only want to change the HTML in one place.
Am I approaching this from a “non-Django” mind-set?
Any help would be really appreciated. thanks.