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

MenuItem name for parent menu #18

Closed
rogerized opened this issue Oct 18, 2011 · 4 comments
Closed

MenuItem name for parent menu #18

rogerized opened this issue Oct 18, 2011 · 4 comments

Comments

@rogerized
Copy link

Hi,

in the class MenuItem i read the following comment:

protected $name = null; // the name of this menu item (used for id by parent menu)

If it should use the name to actually prefix the parent element for a multidimensional menu, it does not work. But maybe i expect something wrong? My class for parent (ul) is named "menu_level_1", "menu_level_2" and so on (I use with the TwigRenderer). Even for another menutree. So i have the same name for alle Submenus in all menus.

Hopefully my problem is understandable. It is a very nice Bundle though ;)

@stof
Copy link
Collaborator

stof commented Oct 18, 2011

the menu name is not about what is rendered in the html output but about the tree of items (see the doc about manipulating the items)

@rogerized
Copy link
Author

Okay, then i was on a wrong path. I read the docs - it seems i can not manipulate the parent element of sub nodes - like the classname in the ul tag. Is this correct?

@stof
Copy link
Collaborator

stof commented Oct 18, 2011

you can through the childrenAttributes option (similar to the other attributes). Not sure the doc mention it though as it was added after the others.

@rogerized
Copy link
Author

You are a hero, it works :D

setChildrenAttributes(array('class' => 'bloodyclass')

It is undocumented, but problem is solved.

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