This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
resolved_pattern Django context processor: insert the current url's ResolverMatch object into context. | |
Example use: Set class=active to a menu item, based on the namespace of the currently matched url. | |
<li {% if resolved.namespace == "home" %}class="active"{% endif %}> home </li> | |
or more specifically: | |
<li {% if resolved.view_name == "contact" %}class="active"{% endif %}> contact </li> |