Skip to content

liferay custom navigation

September 24, 2012

liferay custom navigation,

As per my requirement first 4 main pages and their subpages need to display..

<%@ taglib uri=”; prefix=”portlet” %>
<%@ taglib uri=”; prefix=”liferay-theme” %>
<%@page import=”com.liferay.util.portlet.PortletProps”%>
<%@page import=”com.liferay.portal.theme.ThemeDisplay”%>
<%@page import=”com.liferay.portal.model.Layout”%>
<%@page import=”com.liferay.portal.service.LayoutLocalServiceUtil”%>
<%@page import=”java.util.List” %>

int pageIndexStart = Integer.parseInt(PortletProps.get(“page.index.start”));
int pageIndexEnd = Integer.parseInt(PortletProps.get(“page.index.end”));

List<Layout> layoutList = LayoutLocalServiceUtil.getLayouts(themeDisplay.getScopeGroupId(), false, 0, false, pageIndexStart, pageIndexEnd);

<portlet:defineObjects />

<ul style=”list-style-type:none;”>
if(Validator.isNotNull(layoutList) && layoutList.size() > 0) {

for(Layout parentLayout : layoutList) {
System.out.println(“Parent page >>>>>> “+parentLayout.getName(themeDisplay.getLocale()));
<li class=”coursr_flot course_bor_bot course_Marbot”>
<a class=”course_mycou_hd” href=”<%= parentLayout.getFriendlyURL() %>”><%= parentLayout.getName(themeDisplay.getLocale()) %></a>
<ul style=”list-style-type: none; margin: 0px;”>
for(Layout childLayout : parentLayout.getChildren()){
System.out.println(“— Child page >>>>>> “+childLayout.getName(themeDisplay.getLocale()));
%><li class=”course_viewall_link”><a href=”<%= childLayout.getFriendlyURL() %>”><%= childLayout.getName(themeDisplay.getLocale()) %></a></li> <%

After this in portal.proeperties pass the values..


About these ads
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Value addition to Liferay Portal


Get every new post delivered to your Inbox.

%d bloggers like this: