A plugin to display css class based on location
tensh |
|
---|---|
Hi; I made this plugin to determine in which location the user is, and if location matches the url in navigation menu, it returns the class name "active" (or any other, can be set in settings), so that the menu item can switch colors. By now it can be achieved only by "IF" statements. Currently it works only with URLs set to "Handy" urls (custom urls probably as well). For nested categories, provide the Parent category in class parameters (the very first parent category in structure hierarchy) - it doesn't recognize the category depth (YET). Usage: just as you would use it with cot_url(): {PHP|classactive('module','parameters')} - e.g. {PHP|classactive('page','c=news')}. Example menu link with this plugin: <li class="{PHP|classactive('page','c=news')}"><a href="{PHP|cot_url('page', 'c=news')}">News</a></li> Attention: For some reason both plugins cooperate as exected in my localhost, but fail to work on my production external server. Any help? Is it because it has memcache or something? Link to plugin: |
|
Відредаговано: tensh (22.09.2013 10:51, 11 років тому) |