Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Niko Humalamäki
"Sticky" submenu bars
22 de Março de 2012 00:27
Resposta

Niko Humalamäki

Ranking: New Member

Mensagens: 16

Data de entrada: 21 de Fevereiro de 2012

Mensagens recentes

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:

1   
2<ul>
3#foreach ($nav_item in $nav_items)
4        #if($nav_item.isSelected())
5                    #set( $current_nav_item = $nav_item )
6...


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

1
2<ul>   
3#foreach ($nav_child in $current_nav_item.getChildren())
4        #if ($nav_child.isSelected())
5            #set( $current_child_item = $nav_child)
6...


and finally get the third level items from above variable:

1
2if ( $current_child_item.hasChildren() )
3        <ul>
4            #foreach ($nav_child in $current_child_item.getChildren())
5...

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 Humalamäki
RE: "Sticky" submenu bars
22 de Março de 2012 07:28
Resposta

Niko Humalamäki

Ranking: New Member

Mensagens: 16

Data de entrada: 21 de Fevereiro de 2012

Mensagens recentes

Ok, this is apparrently a bug: http://issues.liferay.com/browse/LPS-16102