RE: Liferay 7 : How to get page URL by plid?

thumbnail
Tinh Nguyen, modified 7 Years ago. Junior Member Posts: 31 Join Date: 5/10/18 Recent Posts

Hi all,

I want get page URl by plid and pass params to page, so my portlet can get params such as "http://localhost:8080/group/site/page?param=value". Can i do that?

My code to getPlId :

ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);

Layout layout = LayoutLocalServiceUtil.getFriendlyURLLayout(themeDisplay.getSiteGroupId(), true, "/page");

layout.getPlid();

Vishal Munjani, modified 7 Years ago. Junior Member Posts: 33 Join Date: 2/21/17 Recent Posts

Hello,

You can use below code to fetch current page URI.

themeDisplay.getURLPortal()+themeDisplay.getURLCurrent()

 

Thanks

Vishal Munjani

thumbnail
Tinh Nguyen, modified 7 Years ago. Junior Member Posts: 31 Join Date: 5/10/18 Recent Posts
Vishal Munjani:

Hello,

You can use below code to fetch current page URI.

themeDisplay.getURLPortal()+themeDisplay.getURLCurrent()

 

Thanks

Vishal Munjani

Hi vishal,

Can i get a other page URL ?

themeDisplay.getURLPortal()+ layout.getFriendlyURL()

Thanks for responding.

Tinhnx

 

 

 

 

 

Vishal Munjani, modified 7 Years ago. Junior Member Posts: 33 Join Date: 2/21/17 Recent Posts
Tinh Nguyen:

Can i get a other page URL ?

themeDisplay.getURLPortal()+ layout.getFriendlyURL()

Thanks for responding.

Tinhnx

By above code you can only get current page URI.

 

Thanks

Vishal Munjani

 

 

 

thumbnail
Tinh Nguyen, modified 7 Years ago. Junior Member Posts: 31 Join Date: 5/10/18 Recent Posts

yeah, i found way to get pageURL 

PortalUtil.getLayoutFriendlyURl(layout,themdisplay);

Thanks 

Tinhnx