留言板
IFrame URL Parameters
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
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
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.
the only solution is to customize the iframe portlet.
When im finished with my own customization , i can add here a more detailed description.
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
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