Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
carol u
How to get the "plid" for page??
August 26, 2008 3:14 AM
Answer

carol u

Rank: New Member

Posts: 3

Join Date: August 26, 2008

Recent Posts

I want to get the plid for my page,How do I do that?
saumil nitin baxi
RE: How to get the "plid" for page??
August 26, 2008 3:45 AM
Answer

saumil nitin baxi

Rank: Junior Member

Posts: 37

Join Date: April 6, 2008

Recent Posts

Hi ,

Use the below code to get plid

1
2
3ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute (
4     com.liferay.portal.kernel.util.WebKeys.THEME_DISPLAY);            
5Layout layout = themeDisplay.getLayout();
6long plid = layout.getPlid() ;
ankit yakkundi
RE: How to get the "plid" for page??
August 27, 2010 2:15 AM
Answer

ankit yakkundi

Rank: Regular Member

Posts: 221

Join Date: March 4, 2010

Recent Posts

Hi..
Where do i have to copy the code??? Can i directly copy it in view.jsp page of the portlet???
Basically i want to open a portlet when i click on the link of simple jsp portlet.
Can anyone suggest how to do that???


As far as i know i will need portlet name and plid.
Can anyone suggest me the code for view.jsp????


Any idea or suggestions are welcome..
Thanks in advance..
Rishi Dev Gupta
RE: How to get the "plid" for page??
August 27, 2010 2:59 AM
Answer

Rishi Dev Gupta

Rank: Expert

Posts: 255

Join Date: November 23, 2008

Recent Posts

I have done this for struts portlet and you can modify the code accordingly


1
2PortletURL regionURL = new PortletURLImpl(request, "ABD", plid, PortletRequest.RENDER_PHASE);
3regionURL.setPortletMode(PortletMode.VIEW);
4regionURL.setWindowState(WindowState.MAXIMIZED);
5regionURL.setParameter("struts_action", "/ext/undp/se/classification/benchmark");


on the anchor tag use the url created above


1
2
3<a href="<%=regionURL.toString()%>"><liferay-ui:message key="open-me" />    </a>
ankit yakkundi
RE: How to get the "plid" for page??
August 27, 2010 5:02 AM
Answer

ankit yakkundi

Rank: Regular Member

Posts: 221

Join Date: March 4, 2010

Recent Posts

Hi..
Can you please specify what all changes i need to make?? I am very much confussed...
I am attaching two files ie view.jsp and error.bmp file..

please review and let me know the changes...

i want to open wiki portlet whose name is 36 from asimple jsp portlet.
Attachments: error.bmp (105.7k), view.jsp (0.6k)
Aditya Bhardwaj
RE: How to get the "plid" for page??
October 20, 2015 11:47 PM
Answer

Aditya Bhardwaj

Rank: Junior Member

Posts: 73

Join Date: January 8, 2015

Recent Posts

Hi,
I know its too late but may be this can help somebody. If your page name is for example about than you can get the plid as:-

String pageName="/about";
long plid = 0L;
try {
plid = LayoutLocalServiceUtil.getFriendlyURLLayout(themeDisplay.getScopeGroupId(), false, pageName).getPlid();
System.out.println("Pliid==>"+plid);
} catch (Exception e) {
e.printStackTrace();
}