Hey,I'm trying this right now:
{% set currentItem = knp_menu_get('main').currentItem %}{{ knp_menu_render(currentItem) }}This works fine to show the children of that page, but now I have this problem:IA:Homepage (/menu/main)
-- Contact us (/menu/main/contact)
-- Map (/menu/main/contact/map)
-- About us (/menu/main/about)
-- Staff list (/menu/main/about/staff)If I go to the 'About us' page, Staff list shows up, which is fine, when I go to the 'Staff list page' nothing shows up, and there is no way to go back to the node above it.What I would need to do is something like:{% set currentItem = knp_menu_get('main').currentItem %}{% set breadcrumbs = currentItem.breadcrumbsArray %}{{ knp_menu_render(breadcrumbs[1]) }}Unfortunately I can't access [1] from that array in twig, unless I'm doing something wrong. If I did that then I would always have subnavigation start right below the homepage.Cheers
On Thu, Jun 14, 2012 at 9:41 PM,
Re the second point. If you just want to show a menu of children for your current page (e.g. show staff-list when on the about us page), then you do as you pasted in irc - just get the menu item for current page and use that as the menu root when you render. You can still define things like depth etc and it should only show the children of that node down to the depth you specify.Pete
On Thursday, 14 June 2012 12:53:59 UTC+1, Uwe Jäger wrote:
Hi,
from my understanding of the menu bundle, main is the menu, and it's
children are the items displayed in the menu. Maybe this becomes
clearer when you consider the scenario where you have more than one
menu, eg in the site's footer. So you should actually change your
structure to have an menu item called "home-item" as sibling of
contact and about.
Your request would result in one item "main" being display with
children contact and about.
Not sure how to do the other stuff but I think it's possible. Just
look at the bundles code and docs.
Cheers
Uwe
2012/6/14 Neil Ferreira
On Thu, Jun 14, 2012 at 9:41 PM, Petesiss wrote:
Re the second point. If you just want to show a menu of children for your current page (e.g. show staff-list when on the about us page), then you do as you pasted in irc - just get the menu item for current page and use that as the menu root when you render. You can still define things like depth etc and it should only show the children of that node down to the depth you specify.Pete
On Thursday, 14 June 2012 12:53:59 UTC+1, Uwe Jäger wrote:
Hi,
from my understanding of the menu bundle, main is the menu, and it's
children are the items displayed in the menu. Maybe this becomes
clearer when you consider the scenario where you have more than one
menu, eg in the site's footer. So you should actually change your
structure to have an menu item called "home-item" as sibling of
contact and about.
Your request would result in one item "main" being display with
children contact and about.
Not sure how to do the other stuff but I think it's possible. Just
look at the bundles code and docs.
Cheers
Uwe
2012/6/14 Neil Ferreira