Foren

How to add more than one navigation bar

thumbnail
danish mohd, geändert vor 12 Jahren.

How to add more than one navigation bar

Regular Member Beiträge: 187 Beitrittsdatum: 05.03.12 Neueste Beiträge
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.
Bradley Wood, geändert vor 12 Jahren.

RE: How to add more than one navigation bar

thumbnail
Patrick Ott, geändert vor 12 Jahren.

RE: How to add more than one navigation bar

New Member Beiträge: 16 Beitrittsdatum: 21.02.12 Neueste Beiträge
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
thumbnail
danish mohd, geändert vor 12 Jahren.

RE: How to add more than one navigation bar

Regular Member Beiträge: 187 Beitrittsdatum: 05.03.12 Neueste Beiträge
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 .
thumbnail
danish mohd, geändert vor 12 Jahren.

Solved:RE: How to add more than one navigation bar (Antwort)

Regular Member Beiträge: 187 Beitrittsdatum: 05.03.12 Neueste Beiträge
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, geändert vor 10 Jahren.

RE: Solved:RE: How to add more than one navigation bar

New Member Beiträge: 3 Beitrittsdatum: 03.06.13 Neueste Beiträge
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
thumbnail
Varsha ., geändert vor 10 Jahren.

RE: Solved:RE: How to add more than one navigation bar

Regular Member Beiträge: 187 Beitrittsdatum: 05.03.12 Neueste Beiträge
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.

<nav class="sort-pages modify-pages" id="navigation">
	

	<ul>
		#foreach ($nav_item in $nav_items)
		#if($nav_item.getName().substring(0,2) == "fn")
			
			 #if ($nav_item.getName()=="fn-home")
				   <li class="selected" id="navBackground" style=" padding-top: 1px;  height: 32px;">
							   
			#elseif ($nav_item.isSelected())
				</li><li class="selected" id="nav1Button">
			#else
				</li><li id="nav1Button">
			#end

				#if ($nav_item.getName()=="fn-home")
				    <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>
				#else
					<a href="$nav_item.getURL()" $nav_item.gettarget()><span>$nav_item.icon() $htmlUtil.escape($nav_item.getName().substring(3))</span></a>
				#end
				
			</li>
			#end
		#end
		
	</ul>
</nav>

<nav class="sort-pages modify-pages" id="navigation">
	

	<ul>
		#foreach ($nav_item in $nav_items)
		#if($nav_item.getName().substring(0,2) == "sn")
			
			 #if ($nav_item.getName()=="sn-home")
				   <li class="selected" id="navBackground" style=" padding-top: 1px;  height: 32px;">
							   
			#elseif ($nav_item.isSelected())
				</li><li class="selected" id="nav1Button">
			#else
				</li><li id="nav1Button">
			#end

				#if ($nav_item.getName()=="fn-home")
				    <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>
				#else
					<a href="$nav_item.getURL()" $nav_item.gettarget()><span>$nav_item.icon() $htmlUtil.escape($nav_item.getName().substring(3))</span></a>
				#end
				
			</li>
			#end
		#end
		
	</ul>
</nav>
Roy Sarango, geändert vor 10 Jahren.

RE: Solved:RE: How to add more than one navigation bar

New Member Beiträge: 3 Beitrittsdatum: 03.06.13 Neueste Beiträge
It worked like a charm!
Thanks