留言板

IFrame URL Parameters

Wessel Oosthuizen,修改在11 年前。

IFrame URL Parameters

Junior Member 帖子: 25 加入日期: 12-8-9 最近的帖子
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,修改在11 年前。

RE: IFrame URL Parameters

Junior Member 帖子: 94 加入日期: 12-2-20 最近的帖子
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,修改在8 年前。

RE: IFrame URL Parameters

New Member 帖子: 5 加入日期: 14-8-1 最近的帖子
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,修改在11 年前。

RE: IFrame URL Parameters

Junior Member 帖子: 94 加入日期: 12-2-20 最近的帖子
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,修改在11 年前。

RE: IFrame URL Parameters

Liferay Master 帖子: 875 加入日期: 11-1-7 最近的帖子
You can do your changes by using hook. Look into html/portlet/iframe/view.jsp