Django Activelink

screenshot of Django Activelink

NO LONGER MAINTAINED A Django template library for checking whether the current page matches a given URL. Useful for highlighting active links in menus.

Overview

django-activelink is a Django template library that allows users to check whether the current page matches a given URL. This library is particularly useful for highlighting active links in menus. It requires the current request object to be available in the template's context and supports Django version 1.3 and above.

Features

  • ifactive: This template tag checks whether the provided URL matches the current request URL.
  • ifstartswith: This template tag checks whether the beginning of the current URL matches the provided URL.
  • ifcontains: This template tag checks whether the current URL contains the provided URL.

Summary

django-activelink is a Django template library that enables users to check whether the current page matches a given URL. It provides template tags such as ifactive, ifstartswith, and ifcontains for this purpose. By using these template tags, developers can easily highlight active links in menus. The library requires the current request object to be available in the template's context and supports Django version 1.3 and above. The installation and usage instructions are provided in the documentation for easy implementation.