We have been creating some real cool stuff with drupal CMS and django since January 2007. That is why most of our clients come back to us when they have to get a second(or third or forth) project done
Drop us an email at info (at) ikraftsoft (dot) com to know more about what kind of work we have accomplished and what our clients say about our work.
Visit http://ikraftsoft.com if you prefer, but most of the stuff about our knowledge is here ;).
A common task in a web developer’s day to day work is to add an ‘active’ class to anchor tags for styling the link to currently active page. In PHP world, this generally involves anĀ if-else chain. But how do we do it in Django?
I searched the web but couldn’t find anything specific; therefore I coded a simple template tags for the purpose.
This little template tag can be used both with url names as well as the actual url strings. Check them out.
Here is the template tag code.
and here is how to use it in your templates.