Dry way to apply current class to navigation elements in django templates
- by Lakshman Prasad
Say there are navigations, nav1, nav2, nav3 and many subnavs within each of them.
For the css effect, you need to apply class=current to the currently selected navs.
What is the dry way to do that.
For the subnavs, you can check to see if request.get_full_path is the same as the url that subnav refers to, in the base template.
How can you make it dry for the navigation too.