Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Liferay 7 : How to get page URL by plid?
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();
Hello,
You can use below code to fetch current page URI.
themeDisplay.getURLPortal()+themeDisplay.getURLCurrent()
Thanks
Vishal Munjani
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
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
yeah, i found way to get pageURL
PortalUtil.getLayoutFriendlyURl(layout,themdisplay);
Thanks
Tinhnx