Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Mohammad Danish
How to add more than one navigation bar
March 5, 2012 9:29 AM
Answer

Mohammad Danish

Rank: Regular Member

Posts: 131

Join Date: March 5, 2012

Recent Posts

Hello Everyone,
I am new to liferay .I am unable to put the navigation bar so that the menu items may be added dynamically as shown in the attachment .

I have tried putting another another navigation.vm file but it does not worked for me.can you please help me to do so.
Attachment

Attachments: Untitled.jpg (17.0k)
Anonymous
RE: How to add more than one navigation bar
March 5, 2012 9:49 AM
Answer

Anonymous

Are you wanting the child menu to show or do you want it to wrap around?
Patrick Ott
RE: How to add more than one navigation bar
March 5, 2012 12:29 PM
Answer

Patrick Ott

Rank: New Member

Posts: 16

Join Date: February 20, 2012

Recent Posts

Hey,

this is also a point on my task-list.
I would like to add something like a navigation bar, which shows links to all my communities i have running on my server. Is there
a Portlet avalible which does this for me?

Thanks in advance,
Patrick
Mohammad Danish
RE: How to add more than one navigation bar
March 5, 2012 8:34 PM
Answer

Mohammad Danish

Rank: Regular Member

Posts: 131

Join Date: March 5, 2012

Recent Posts

Thanks for your reply Wood,
Actually this not a sub menu this is another separate menu bar.
It's like menu bar 1 and another menu bar 2 on which the pages may be added.
Thank you .
Mohammad Danish
Solved:RE: How to add more than one navigation bar
March 17, 2012 5:39 AM
Answer

Mohammad Danish

Rank: Regular Member

Posts: 131

Join Date: March 5, 2012

Recent Posts

Hi we have solved that problem.
What we have to do is in the navigation.vm put one more <nav>
and then specify the logic that where we want to land the page ie in 1st navigation or the 2nd navigation.
Roy Sarango
RE: Solved:RE: How to add more than one navigation bar
July 1, 2013 1:25 PM
Answer

Roy Sarango

Rank: New Member

Posts: 3

Join Date: June 2, 2013

Recent Posts

Hello Varsha.
I did what you said but I'm not sure how to handle which page goes to one bar and which one goes to the second one.
Could you please give me more info on this.
Thanks
Mohammad Danish
RE: Solved:RE: How to add more than one navigation bar
July 1, 2013 9:26 PM
Answer

Mohammad Danish

Rank: Regular Member

Posts: 131

Join Date: March 5, 2012

Recent Posts

Roy Sarango:

I did what you said but I'm not sure how to handle which page goes to one bar and which one goes to the second one.

Fristly you are to have two nav tags.
Then you are suppose to have a differentiation between the pages of the two bars.
For example in the below code we have used fn and sn to differentiate between the two pages.
If a page name starts with fn then it goes to 1st navigation bar else it goes to 2nd navigation bar.
 1
 2<nav class="sort-pages modify-pages" id="navigation">
 3   
 4
 5    <ul>
 6        #foreach ($nav_item in $nav_items)
 7        #if($nav_item.getName().substring(0,2) == "fn")
 8            
 9             #if ($nav_item.getName()=="fn-home")
10                   <li class="selected" id="navBackground" style=" padding-top: 1px;  height: 32px;">
11                              
12            #elseif ($nav_item.isSelected())
13                <li class="selected" id="nav1Button">
14            #else
15                <li id="nav1Button">
16            #end
17
18                #if ($nav_item.getName()=="fn-home")
19                    <a href="/web/guest/home" style="color:#fff;padding-left: 42px;width: 68px;" ><span style="margin-right: 15px; ">$nav_item.getName().substring(3)</span></a>
20                #else
21                    <a href="$nav_item.getURL()" $nav_item.getTarget()><span>$nav_item.icon() $htmlUtil.escape($nav_item.getName().substring(3))</span></a>
22                #end
23               
24            </li>
25            #end
26        #end
27       
28    </ul>
29</nav>
30
31<nav class="sort-pages modify-pages" id="navigation">
32   
33
34    <ul>
35        #foreach ($nav_item in $nav_items)
36        #if($nav_item.getName().substring(0,2) == "sn")
37            
38             #if ($nav_item.getName()=="sn-home")
39                   <li class="selected" id="navBackground" style=" padding-top: 1px;  height: 32px;">
40                              
41            #elseif ($nav_item.isSelected())
42                <li class="selected" id="nav1Button">
43            #else
44                <li id="nav1Button">
45            #end
46
47                #if ($nav_item.getName()=="fn-home")
48                    <a href="/web/guest/home" style="color:#fff;padding-left: 42px;width: 68px;" ><span style="margin-right: 15px; ">$nav_item.getName().substring(3)</span></a>
49                #else
50                    <a href="$nav_item.getURL()" $nav_item.getTarget()><span>$nav_item.icon() $htmlUtil.escape($nav_item.getName().substring(3))</span></a>
51                #end
52               
53            </li>
54            #end
55        #end
56       
57    </ul>
58</nav>
Roy Sarango
RE: Solved:RE: How to add more than one navigation bar
July 8, 2013 9:28 AM
Answer

Roy Sarango

Rank: New Member

Posts: 3

Join Date: June 2, 2013

Recent Posts

It worked like a charm!
Thanks