How to show site page urls in Liferay jsp portlet? -


i show site page urls in liferay jsp portlet. i'm using liferay 6.1 ee. use page's localized title , other custom fields added (e.g. cssclass).

i have done same navigation bar, velocity theme:

#if (!$page_group.isuser())      #set($layoutlocalservice = $servicelocator.findservice("com.liferay.portal.service.layoutlocalservice"))      <ul id="quicklinks">         <li>             #set($currfriendlyurl = "/i-want-to")             #set($currlayout = $layoutlocalservice.getfriendlyurllayout($group_id, true, $currfriendlyurl))             <a href="$currlayout.getregularurl($request)" $currlayout.gettarget() class="$currlayout.getexpandobridge().getattribute('cssclass')">$currlayout.getname($locale)</a>         </li>     </ul> #end 

how write same code using jsp?

i have found similar quesion, there not clear code example jsp in answers.

managed implement jsp follows:

<%@ page import="com.liferay.portal.service.layoutlocalserviceutil" %> <% if (!layout.getgroup().isusergroup()) { %>     <ul id="quicklinks">         <li>             <% layout currlayout = layoutlocalserviceutil.getfriendlyurllayout(scopegroupid, true, "/i-want-to"); %>             <a href="<%=currlayout.getregularurl(request)%>" <%=currlayout.gettarget()%> class='<%=currlayout.getexpandobridge().getattribute("cssclass")%>'><%=currlayout.getname(locale)%></a>         </li>     </ul> <% } %> 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -