I am generating menu with such tags:
<div class="animatedtabs">
<ul>
{% for item in menu_items %}
<li><a href="{{ item.url }}" title="{{ item.name }}"><span>{{ item.name }}</span></a></li>
{% endfor %}
</ul>
</div>
What I want to do, I want to add class=”selected” to li, after the link is clicked, and to remove all other class=”selected” on other li’s…
Also I wonder, how to show menu in the way, so the first item is selected by default… But then when another linked is clicked, then class=”selected” is toggled
There is a related question about navigation menus in Django:
Navigation in django
This answer has a good example of using a template tag for adding the classes to the
lielements.Navigation in django