Forums de discussion

Making Public & Private Pages as Left Navigation Panel Tabs

Prateeksha Mandloi, modifié il y a 9 années.

Making Public & Private Pages as Left Navigation Panel Tabs

Regular Member Publications: 112 Date d'inscription: 05/02/14 Publications récentes
Hello all,

I am trying to make Public and Private Pages as Tabs of Side navigation portlet. But I am stuck, as the links for Public and Private pages in control panel are dynamically generated,. so how should I proceed ??

Can anyone help ??

Thanks in advance
thumbnail
Sandip Patel, modifié il y a 9 années.

RE: Making Public & Private Pages as Left Navigation Panel Tabs

Regular Member Publications: 205 Date d'inscription: 05/01/11 Publications récentes
Hi,
You can go with Liferay OOTB Navigation porltet and create hook and customize your own way to display public and private page.
If this solution becomes complex then you can create your custom porltet and with use of list of Layouts(Pages) u can display link which you want to display

Regards,
Sandip Patel
thumbnail
Subhash Pavuskar, modifié il y a 9 années.

RE: Making Public & Private Pages as Left Navigation Panel Tabs

Regular Member Publications: 234 Date d'inscription: 13/03/12 Publications récentes
Hi,

If you want to display Public and private page as a left navigation bar then create theme in and in _diff/templates folder create vm file(Eg :side_navigation.vm)
and do something like below snippet
#foreach($group in $user.getGroups())
						#if ($group.descriptiveName==$siteName)
									#set ($globalLayouts_private = $layoutLocalService.getLayouts($group.groupId,true,0))
							   		#set ($globalLayouts_public = $layoutLocalService.getLayouts($group.groupId,false,0))
						  		#foreach ($private_layout in $globalLayouts_private)
						  			<li><a href="$portalUtil.getLayoutFriendlyURL($private_layout, $theme_display)?siteName=$siteName"> $private_layout.getName($locale) </a></li>
											#if($private_layout.hasChildren())
												<div>
													 <ul>
													 	<li><a href="$portalUtil.getLayoutFriendlyURL($private_layout, $theme_display)?siteName=$siteName"> $private_layout.getName($locale) </a></li>
														#foreach($private_layout_chilld in $private_layout.getAllChildren())
															<div>
														 		<ul>
																	<li>
																		<a href="$portalUtil.getLayoutFriendlyURL($private_layout_chilld, $theme_display)?siteName=$siteName"> $private_layout_chilld.getName($locale)</a>
																	</li>
																</ul>
															</div>
														#end
													</ul>
									 			</div>
									 		#end
								#end
					
					  			#foreach ($public_layout in $globalLayouts_public)
					  			  <li><a href="$portalUtil.getLayoutFriendlyURL($public_layout, $theme_display)?siteName=$siteName">$public_layout.getName($locale)</a></li>
												#if($public_layout.hasChildren())
													<div>
														 <ul>
														 <li><a href="$portalUtil.getLayoutFriendlyURL($public_layout, $theme_display)?siteName=$siteName">$public_layout.getName($locale)</a></li>
																#foreach($public_layout_chilld in $public_layout.getAllChildren())
																	<div>
														 				<ul>
																			<li>
																				<a href="$portalUtil.getLayoutFriendlyURL($public_layout_chilld, $theme_display)?siteName=$siteName">$public_layout_chilld.getName($locale)</a>
																			</li>
																		</ul>
																	</div>
																#end
														</ul>	
													</div>
												#end
								#end
						#end
				 #end


And in portal_normal add this code

#if ($is_signed_in)
			<div id="menu" style="float:left;width:20%; background-color:#882345;padding: 3px;margin-top: 8px;">
				#if ($has_navigation || $is_signed_in)
					#parse ("$full_templates_path/side_navigation.vm")
				#end
			</div>
		#end


hope above may help you .