.. _templatetags:

Template tags
=============

.. module:: swingers.templatetags
   :synopsis: Swingers' template tags.

Swingers' custom template tags.


.. currentmodule:: swingers.templatags.active

.. highlightlang:: html+django

.. templatetag:: active

.. function:: active

Calculates whether the url passed to the tag is the currently active url.
Takes ``request`` as the first argument, and a list of urls afterwards.
Returns ``'active'`` if it is, ``''`` otherwise.

Sample usage::

    {% load active %}

    {% url 'weatherdata_list' as weatherdata_list %}

    <li class="dropdown {% active request weatherdata_list %}">
    {# rest of navigation #}
