Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add class to currently viewed navigation item #77

Closed
maybegeek opened this issue Apr 4, 2017 · 1 comment
Closed

add class to currently viewed navigation item #77

maybegeek opened this issue Apr 4, 2017 · 1 comment

Comments

@maybegeek
Copy link
Contributor

Hi there,

our navigation could get more styleable, if we had a class value (e.g. current) for the currently viewed item:

<a ... class="cms_nav_link current" ... >

  • For the pages we would have currently viewed page title == menu item title
  • We also would have to check for static front page and the list view of posts (which could have a own static page), as well as decide if we want to add a class value (perhaps current-parent) to the menu item in which the posts are, even if they are viewed in single view.

thanks

@chrisdiana
Copy link
Owner

Hey @maybegeek with the release of v2.0 and the restructuring of how CMS.js handles templates/nav this would probably best be solved with a custom plugin that could trigger onroute and check the instance's state to match on that. I'll close this for now but I think this would be a great idea to add to the new feature examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants