[go: up one dir, main page]

Skip to content

jswhetstone/twig-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

jswhetstone/twig-extension

Some useful Twig functions for context-relevant class rendering.

{{ getActiveClass('/some/page') }}

Will return 'active' (without quotes) if the current URI contains the string specified. Good for rendering the active state on Bootstrap nav elements. Pass an empty string '' to check for root.

{{ getPageClasses() }}

Will return a class-ready string representation of the current URI. Each directory in the hierarchy is represented by a separate class. The root directory will return 'home' (without quotes).

license

This code is licensed under WTFPL

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages