Foren

"Sticky" submenu bars

Niko H, geändert vor 12 Jahren.

"Sticky" submenu bars

New Member Beiträge: 16 Beitrittsdatum: 21.02.12 Neueste Beiträge
Hi,

Can I somehow get static velocity variables? I'm trying to get the information of the last selected navigation item to the new render phase, in order to be able to have the right submenu open after a 3rd level item has been clicked.

eg. I have a menubar thing like this:

Level1a
Level2a Level2b Level2c
Level3a Level3b Level3d

the things shown on a level depends on the upper level choice (say it is showing the 3rd level of Level2b link). So when one clicks Level3b, I can't get the right 3rd level menu open once browser loads the layout of the page Level3b. So after the click the menu is like:

Level1a
Level2a Level2b Level2c

but the browser is on a 3rd. level page. So is it now time to perhaps learn javascript or where would be a good place to look on this sort of thing?

Now I store the selected nav_item to a velocity variable:

    
    #foreach ($nav_item in $nav_items) #if($nav_item.isSelected()) #set( $current_nav_item = $nav_item ) ...


and then get it's childern to a 2nd level menulist


    #foreach ($nav_child in $current_nav_item.getChildren()) #if ($nav_child.isSelected()) #set( $current_child_item = $nav_child) ...


and finally get the third level items from above variable:


if ( $current_child_item.hasChildren() )
        
    #foreach ($nav_child in $current_child_item.getChildren()) ...

Somehow liferay remebers the toplevel selected navitem after clicking any of the lower level items, but as I already wrote, it doesn't remember the 2nd level selected navitem after a third level item has been clicked.
Niko H, geändert vor 12 Jahren.

RE: "Sticky" submenu bars

New Member Beiträge: 16 Beitrittsdatum: 21.02.12 Neueste Beiträge
Ok, this is apparrently a bug: http://issues.liferay.com/browse/LPS-16102