I'm using django with Twitter Bootstrap. My current view resembles one of the examples provided. Looking at the example, one can imagine the user clicking one of the links in the sidebar to see different views, each framed with this same sidebar. One would imagine that the link selected would then be highlighted just like the example using the code:
<li class="active"><a href="/sample/link/here/">Link</a></li>
The active class needs to be attached to the correct menu item. How might I assign this "active" class to the correct menu item? Originally, I tried using a variable from my view to assign it with jquery:
$(document).ready(function() {
$("#{{ current_view }}_nav").addClass('active');
});
<li id="linkone_nav"><a href="/sample/link/here/">Link</a></li>
This seems cumbersome though. It requires that I pass the id to the template from the view. Lots of ids to manage as well. Is there a better / more preferred way to assign this active class?