Simplify navigation and URL-based logic in your templates.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Sprout Active

Simplify navigation and URL-based logic in your templates.

Sprout Active makes it simple to control the active classname in your navigation or conditional content based on your URL segments or your full URL.


Sprout Active provides the active and activeClass Twig Filters to test for matching URL segments and output a class to make an element active.

The most simple version of these filters will match the first segment in the URL If no match is found, they will return blank.

{{ active('about-us') }} {# Output if match: active #}

{{ activeClass('about-us') }} {# Output if match: class="active" #}

{{ activeClass(entry.slug) }}

See the documentation for more advanced use cases.


See the Sprout Website for documentation, guides, and additional resources.