Fórum

Access to page-URL inside portlet

pawan chauhan, modificado 11 Anos atrás.

Access to page-URL inside portlet

Junior Member Postagens: 75 Data de Entrada: 08/10/12 Postagens Recentes
Hi all,

I want to know if it's possible to access the info of a page in a portlet added on that page.
I mean is there any way to get a variable inside a porlet that may tell on which page/friendly URL the portlet has been added to.

Kindly help.
Regards,
Pawan Chauhan.
thumbnail
Bart Simpson, modificado 11 Anos atrás.

RE: Access to page-URL inside portlet

Liferay Master Postagens: 522 Data de Entrada: 29/08/11 Postagens Recentes
I want to know if it's possible to access the info of a page in a portlet added on that page.

If the portlet is already on the page then you should be able to get this info from themeDisplay and get the layout (which is basically is a page in liferay), here is the method
Layout com.liferay.portal.theme.ThemeDisplay.getLayout()


Hope it helps
pawan chauhan, modificado 11 Anos atrás.

RE: Access to page-URL inside portlet

Junior Member Postagens: 75 Data de Entrada: 08/10/12 Postagens Recentes
Thanks for the quick reply Bart..
I would like to ask a little more,

Suppose i have added two pages - say "home" n "tools" (which have the same custom theme n layout applied)

and added the same portlet on both the pages .. will i get different values and will i be able to know from which page(portlet), I am getting the values.

As i ask i am already on to it ...

Regards,
Pawan Chauhan.
Rahul Sharma, modificado 11 Anos atrás.

RE: Access to page-URL inside portlet

Junior Member Postagens: 59 Data de Entrada: 11/01/12 Postagens Recentes
Yes you will be getting different values when you place that portlet on two different pages and you will be able to get which page(portlet) is giving values,just use themeDisplay object to get the values.
thumbnail
Bart Simpson, modificado 11 Anos atrás.

RE: Access to page-URL inside portlet

Liferay Master Postagens: 522 Data de Entrada: 29/08/11 Postagens Recentes
yes, indeed the values for layout will be different, Layout in liferay represents a page and not the look and feel thing that you have seen as container for displaying portlets.
Hope it helps