Foros de discusión

IFrame URL Parameters

Wessel Oosthuizen, modificado hace 11 años.

IFrame URL Parameters

Junior Member Mensajes: 25 Fecha de incorporación: 9/08/12 Mensajes recientes
Hello,

I would like to pass any parameter in the URL of an IFrame portlet. For example, if the URL is http:www.google.com, I would like to pass the logged in username, password, and maybe a permission set for the logged in user in the URL.

So the URL would end up looking something like "Http://www.google.com?username=<uname>&password=<pwd>&permissions=<permissions>"

Is it possible to do this without any custom coding, like are there any placeholders for those values built into Liferay? For example, if you specify @username@ the portlet would automatically know to replace that value with the loggedin users username at runtime.

So essentially the above URL in the portlet configuration would look something like:
"Http://www.google.com?username=@username@&password=@password@&permissions=@permissions@"

Thanks
Wessel Oosthuizen
thumbnail
Michele Zanarotti, modificado hace 11 años.

RE: IFrame URL Parameters

Junior Member Mensajes: 94 Fecha de incorporación: 20/02/12 Mensajes recientes
As they say there http://www.liferay.com/community/forums/-/message_boards/message/4961541
the only solution is to customize the iframe portlet.

When im finished with my own customization , i can add here a more detailed description.
thumbnail
Diego García, modificado hace 8 años.

RE: IFrame URL Parameters

New Member Mensajes: 5 Fecha de incorporación: 1/08/14 Mensajes recientes
In Liferay 6.x it's not necessary customize the iframe portlet:
https://www.liferay.com/es/community/forums/-/message_boards/message/70734394
thumbnail
Michele Zanarotti, modificado hace 11 años.

RE: IFrame URL Parameters

Junior Member Mensajes: 94 Fecha de incorporación: 20/02/12 Mensajes recientes
Here's the details :

I wanted to pass the site_id to the iframe. So i used this at the end java code of view.jsp (right before the jstl/aui script parts).

iframeSrc = iframeSrc.replaceAll("\\$site_id", themeDisplay.getLayout().getGroupId()+"");

This will do the trick. In portlet config you can set now your url like that :
sourceUrl :
http://someUrl/$site_id
thumbnail
Jitendra Rajput, modificado hace 11 años.

RE: IFrame URL Parameters

Liferay Master Mensajes: 875 Fecha de incorporación: 7/01/11 Mensajes recientes
You can do your changes by using hook. Look into html/portlet/iframe/view.jsp