Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Liferay page without header and menu Micael Ericsson April 1, 2014 6:03 AM
RE: Liferay page without header and menu Juan Gonzalez April 1, 2014 7:04 AM
RE: Liferay page without header and menu Micael Ericsson April 1, 2014 7:18 AM
RE: Liferay page without header and menu Krzysztof Gołębiowski April 1, 2014 9:31 AM
RE: Liferay page without header and menu Micael Ericsson April 1, 2014 11:36 AM
RE: Liferay page without header and menu Krzysztof Gołębiowski April 2, 2014 2:30 AM
RE: Liferay page without header and menu Juan Gonzalez April 2, 2014 2:32 AM
RE: Liferay page without header and menu Krzysztof Gołębiowski April 2, 2014 3:19 AM
RE: Liferay page without header and menu Juan Gonzalez April 2, 2014 3:28 AM
RE: Liferay page without header and menu Juan Gonzalez April 2, 2014 3:34 AM
RE: Liferay page without header and menu Tomas Polesovsky April 2, 2014 7:52 AM
RE: Liferay page without header and menu Krzysztof Gołębiowski April 2, 2014 12:59 PM
RE: Liferay page without header and menu Micael Ericsson April 2, 2014 1:44 PM
RE: Liferay page without header and menu Krzysztof Gołębiowski April 3, 2014 12:10 AM
RE: Liferay page without header and menu Kalpana P April 8, 2014 4:35 AM
RE: Liferay page without header and menu Tomas Polesovsky April 9, 2014 12:19 AM
RE: Liferay page without header and menu Murat Koese January 6, 2016 10:02 AM
RE: Liferay page without header and menu Pina Springer April 19, 2016 7:07 AM
RE: Liferay page without header and menu 强 邓 July 25, 2016 1:23 AM
RE: Liferay page without header and menu Mohammad Azharuddin July 24, 2015 12:24 AM
RE: Liferay page without header and menu Rajaneesh Kethavarapu August 8, 2017 11:06 PM
Micael Ericsson
Liferay page without header and menu
April 1, 2014 6:03 AM
Answer

Micael Ericsson

Rank: Regular Member

Posts: 157

Join Date: December 11, 2012

Recent Posts

I am developing a small site with some pages populated with my portlets.

One of the portlets/pages ( result presentation portlet) should be a part of another site. My page should be displayed within a certain part of a specific page in that site. I have a boundary to fit the report within. My sites settings, such as theme, header, menu, login etc should not be visible in this specific page. Adjusting theme for this single page to adopt the parent site css is not a problem.

But how do I display only my portlet area in the other site? None of my sites header, menu, login link etc should be visible.
Juan Gonzalez
RE: Liferay page without header and menu
April 1, 2014 7:04 AM
Answer

Juan Gonzalez

Rank: Liferay Legend

Posts: 3069

Join Date: October 28, 2008

Recent Posts

Hi Micael,

maybe you want to embed your portlets or configure and use WSRP.
Micael Ericsson
RE: Liferay page without header and menu
April 1, 2014 7:18 AM
Answer

Micael Ericsson

Rank: Regular Member

Posts: 157

Join Date: December 11, 2012

Recent Posts

Juan Gonzalez:
Hi Micael,

maybe you want to embed your portlets or configure and use WSRP.


I don't think these suggestions will work.
The other system is a .net based system. I can't include any of my code nor a WSRP. The only thing I can do is include a URL to a page on my site. I hope this explains what I want to do.
Krzysztof Gołębiowski
RE: Liferay page without header and menu
April 1, 2014 9:31 AM
Answer

Krzysztof Gołębiowski

Rank: Liferay Master

Posts: 516

Join Date: June 25, 2011

Recent Posts

Maybe you can use the widget mechanism. Go to your portlet, open configuration and go to Sharing -> Any website. There is a javascript that should be put on the other website (but I think you can try to use provided url in iframe on destination system). Personally I haven't used this solution in production (but I always wanted to try emoticon ), we have done once an "iframe integration" but that was simply a page with blank theme containing our portlet.

Regards,
KG
Micael Ericsson
RE: Liferay page without header and menu
April 1, 2014 11:36 AM
Answer

Micael Ericsson

Rank: Regular Member

Posts: 157

Join Date: December 11, 2012

Recent Posts

Krzysztof Gołębiowski:
Maybe you can use the widget mechanism. Go to your portlet, open configuration and go to Sharing -> Any website. There is a javascript that should be put on the other website (but I think you can try to use provided url in iframe on destination system). Personally I haven't used this solution in production (but I always wanted to try emoticon ), we have done once an "iframe integration" but that was simply a page with blank theme containing our portlet.

Regards,
KG


This sounds like the perfect solution for me.
I gave it a little try. From my site (which still is localhost only) I copied the script my portlets configuration presented for sharing:

1<script src="http://localhost:8080/html/js/liferay/widget.js" type="text/javascript"></script>
2<script type="text/javascript">
3    Liferay.Widget({ url: 'http://localhost:8080/widget/web/guest/admin/-/AdHgAdmin_WAR_AdHgAdmin10SNAPSHOT'});
4</script>


For a simple test I created a test.html file and copied this code inside standard html, body tag.

 1<!DOCTYPE html>
 2<html>
 3<head>
 4</head>
 5
 6<body>
 7<h1>Test</h1>
 8<script src="http://localhost:8080/html/js/liferay/widget.js" type="text/javascript"></script>
 9<script type="text/javascript">
10    Liferay.Widget({ url: 'http://localhost:8080/widget/web/guest/admin/-/AdHgAdmin_WAR_AdHgAdmin10SNAPSHOT'});
11</script>
12<p>End</>
13</body>
14</html>


Then I opened this with my web browser. My hope was that the portlet should be loaded with this html page. Since it's all javascript client code.
"Test" and "End" was shown with a number of blank row in between, but no portlet data.

Perhaps it's not possible to test shareing in this way. Do I need to put this code on a server of some sort?
Krzysztof Gołębiowski
RE: Liferay page without header and menu
April 2, 2014 2:30 AM
Answer

Krzysztof Gołębiowski

Rank: Liferay Master

Posts: 516

Join Date: June 25, 2011

Recent Posts

I tested this code and in fact it does not work emoticon (but I think it used to work in the past).

When I run this code, browser console displays the following error:
1Refused to display 'http://host/widget/web/guest/home/-/56_INSTANCE_TtFG4Bd9fkkh' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

I read that X-Frame-Options was introduced recently (2010/11) to prevent vulnerabilities that were caused by "iframing" content. Basically option SAMEORIGIN says that this content can be iframed only on a website with the same domain as origin (http://tools.ietf.org/html/rfc7034#section-2.1). I tested this and put this snippet under the same domain - IFrame with my portlet has been loaded without any problems.

I think this may be and old functionality in Liferay, possibly it was introduced before X-Frame-Options header and it has not been adapted yet (and at the same time, Tomcat/Liferay automatically appends this header to all requests preventing all iframe vulnerabilities). Anyway, I've seen this is managed by separate servlet com.liferay.portal.servlet.WidgetServlet so I think it should be easy to override with ext or servlet filter hook.

I tested this on Liferay 6.2, maybe older versions behave in different way.

Regards,
KG
Juan Gonzalez
RE: Liferay page without header and menu
April 2, 2014 2:32 AM
Answer

Juan Gonzalez

Rank: Liferay Legend

Posts: 3069

Join Date: October 28, 2008

Recent Posts

Hi Krzysztof,

you're right. That is a security improvement made in 6.2 to use that browser security check. I guess this code should work for Firefox or IE, but not for Chrome.
Krzysztof Gołębiowski
RE: Liferay page without header and menu
April 2, 2014 3:19 AM
Answer

Krzysztof Gołębiowski

Rank: Liferay Master

Posts: 516

Join Date: June 25, 2011

Recent Posts

Thanks Juan, I created new jira issue for this case: https://issues.liferay.com/browse/LPS-45611.
Juan Gonzalez
RE: Liferay page without header and menu
April 2, 2014 3:28 AM
Answer

Juan Gonzalez

Rank: Liferay Legend

Posts: 3069

Join Date: October 28, 2008

Recent Posts

Great,

please can you check what browsers are affected with this problem?

Thanks
Juan Gonzalez
RE: Liferay page without header and menu
April 2, 2014 3:34 AM
Answer

Juan Gonzalez

Rank: Liferay Legend

Posts: 3069

Join Date: October 28, 2008

Recent Posts

You can disable that check by changing this property in portal-ext.properties:

1http.header.secure.x.frame.options=false
Tomas Polesovsky
RE: Liferay page without header and menu
April 2, 2014 7:52 AM
Answer

Tomas Polesovsky

LIFERAY STAFF

Rank: Liferay Master

Posts: 653

Join Date: February 13, 2009

Recent Posts

Hi Krzysztof,

put in your portal-ext.properties:
1http.header.secure.x.frame.options.1=/widget/web/guest/home/-/56_INSTANCE_TtFG4Bd9fkkh


Or to allow all widgets from the home page:
1http.header.secure.x.frame.options.1=/widget/web/guest/home/-/


This should help.
Krzysztof Gołębiowski
RE: Liferay page without header and menu
April 2, 2014 12:59 PM
Answer

Krzysztof Gołębiowski

Rank: Liferay Master

Posts: 516

Join Date: June 25, 2011

Recent Posts

Hi Tomáš,
Thank you very much, I've learned something new about 6.2. I think this is also the answer for Micael's question.

Regads,
KG
Micael Ericsson
RE: Liferay page without header and menu
April 2, 2014 1:44 PM
Answer

Micael Ericsson

Rank: Regular Member

Posts: 157

Join Date: December 11, 2012

Recent Posts

Thanks Thomas. This solved my problem and gave me a perfect solution.
Krzysztof Gołębiowski
RE: Liferay page without header and menu
April 3, 2014 12:10 AM
Answer

Krzysztof Gołębiowski

Rank: Liferay Master

Posts: 516

Join Date: June 25, 2011

Recent Posts

Micael, one more thing. If you start using widgets, you could write few words about them in this thread (if there were any problems or you had some specific observations). As I wrote before, I always knew about that functionality but I never used it in production emoticon

Thanks in advance,
KG
Kalpana P
RE: Liferay page without header and menu
April 8, 2014 4:35 AM
Answer

Kalpana P

Rank: New Member

Posts: 5

Join Date: April 8, 2014

Recent Posts

Hi Tomáš,

Is it possible to disable X-Frame-Options to only one page where that can be embedded in any website? Thanks in advance........
Tomas Polesovsky
RE: Liferay page without header and menu
April 9, 2014 12:19 AM
Answer

Tomas Polesovsky

LIFERAY STAFF

Rank: Liferay Master

Posts: 653

Join Date: February 13, 2009

Recent Posts

Kalpana P:
Hi Tomáš,

Is it possible to disable X-Frame-Options to only one page where that can be embedded in any website? Thanks in advance........


Hi,

the syntax is similar / the same. Having a page with URL "/iframe-able", put in your portal-ext.properties:
1http.header.secure.x.frame.options.1=/iframe-able
Mohammad Azharuddin
RE: Liferay page without header and menu
July 24, 2015 12:24 AM
Answer

Mohammad Azharuddin

Rank: Liferay Master

Posts: 504

Join Date: September 17, 2012

Recent Posts

HI Tomas

But when we open popup for configuration.. Again it is blocking ..

Look And Feel option is working.. But not the configuration
Murat Koese
RE: Liferay page without header and menu
January 6, 2016 10:02 AM
Answer

Murat Koese

Rank: New Member

Posts: 11

Join Date: August 17, 2015

Recent Posts

Hi Thomas,

did you try if this works in "Liferay Portal Community Edition 6.2 CE GA5".
For me this doesn'r work. I tried all the options written in this thread.

As i can see the Portal Properties have been loaded.

Thanks, Markus
Attachment

Attachments: Portaleigenschaften.jpg (217.1k)
Pina Springer
RE: Liferay page without header and menu
April 19, 2016 7:07 AM
Answer

Pina Springer

Rank: New Member

Posts: 16

Join Date: February 16, 2010

Recent Posts

Hi to all,

the option http.header.secure.x.frame.options.1 etc. have to be in the system-ext.properties and NOT in portal-ext.properties.
This worked for me.

Best wishes,
Pina
强 邓
RE: Liferay page without header and menu
July 25, 2016 1:23 AM
Answer

强 邓

Rank: New Member

Posts: 1

Join Date: October 7, 2013

Recent Posts

good!!!emoticon
Attachment

Attachment

Attachments: options.png (14.8k), sytem-ext.png (16.8k)
Rajaneesh Kethavarapu
RE: Liferay page without header and menu
August 8, 2017 11:06 PM
Answer

Rajaneesh Kethavarapu

Rank: New Member

Posts: 12

Join Date: February 20, 2013

Recent Posts

HI Thomas as you explained I tried by copying my script tags into a sample HTML file

 1<!DOCTYPE html>
 2<html>
 3<head>
 4<script src="http://localhost:8080/html/js/liferay/widget.js" type="text/javascript"></script>
 5<script type="text/javascript">
 6    Liferay.Widget({ url: 'http://localhost:8080/widget/web/guest/home/-/customerinformation_WAR_ReviewRatingportlet'});
 7</script>
 8</head>
 9<body>
10<h1>This is a Heading</h1>
11</body>
12</html>


and in portlet-ext properties, I tried independently by keeping properties
http.header.secure.x.frame.options.1=/widget/web/guest/home
http.header.secure.x.frame.options.1=/widget/web/guest/home/-/
http.header.secure.x.frame.options=false

But nothing worked for me I am still getting below error

1Refused to display 'http://localhost:8080/widget/web/guest/home/-/customerinformation_WAR_ReviewRatingportlet' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
2widget.js:13 GET http://localhost:8080/widget/web/guest/home/-/customerinformation_WAR_ReviewRatingportlet net::ERR_BLOCKED_BY_RESPONSE



Please give your suggestion

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!