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

Active classes #20

Open
nWidart opened this issue Feb 22, 2015 · 8 comments
Open

Active classes #20

nWidart opened this issue Feb 22, 2015 · 8 comments

Comments

@nWidart
Copy link
Member

nWidart commented Feb 22, 2015

Would it be possible to handle active classes on elements ?

@gravitano
Copy link
Member

I don't know. Maybe you can create a custom presenter class to allow that.

@andersao
Copy link
Contributor

nWidart. Could you explain better how you want to handle the classes ? I do not understand

@nWidart
Copy link
Member Author

nWidart commented Feb 27, 2015

Well, since we add an URL to the MenuItem, it can set the active classes if needed. This is how we do it on a package at work for generating sidebar menus: https://github.com/Maatwebsite/Laravel-Sidebar/blob/master/src/Maatwebsite/Sidebar/SidebarItem.php#L227-L245

@gravitano I don't think this should be in a custom presenter, but in the core of the package itself, since this is basically always needed.

gravitano pushed a commit to pingpong-labs/sky that referenced this issue Apr 6, 2015
146b2d3 allow to set 'inactive' state
dbe4203 Allow to define active state using 'active' attribute. ref: pingpong-labs/menus#20
71f5fe8 register menus file

git-subtree-dir: src/Pingpong/Menus
git-subtree-split: 146b2d320b0a468a7db9628502915490adb3a5f1
@nWidart
Copy link
Member Author

nWidart commented Jun 30, 2015

any update ? As this is still not working.

@gravitano
Copy link
Member

Do you mean change the active class name ?

@nWidart
Copy link
Member Author

nWidart commented Jul 1, 2015

Yes.

@gravitano
Copy link
Member

You can modify the menu's view presenter to allow that. Just publish the package's views and modify the class name as you want. http://sky.pingpong-labs.com/docs/2.1/menus#view-presenter

@nWidart
Copy link
Member Author

nWidart commented Jul 1, 2015

I don't want to modify the class name. I'd like to have an active class name on active elements.
This is not something I set manually... but has to be dynamic.

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

3 participants