Page 1 of 1

Unwanted Navigation Panel Inside the iFrame in the HTML Output

Posted: Tue Aug 06, 2024 6:13 am
by BartoszK
Hi there,

Is it possible to remove the skin/navigation elements from the iFrame in the HTML output? I want the content to be plain local HTML.
(screenshot attached for clarity)

Any help is greatly appreciated.

Cheers,
Bartosz

Re: Unwanted Navigation Panel Inside the iFrame in the HTML Output

Posted: Tue Aug 06, 2024 8:28 am
by NorthEast
But what is going to be inside the iframe?

I'm assuming you're going to produce two different Flare outputs - one with a skin, and one without a skin to display in the iframe.
For the output that is going to be displayed inside the iframe, set the target Skin to (none).

Re: Unwanted Navigation Panel Inside the iFrame in the HTML Output

Posted: Tue Aug 06, 2024 9:28 pm
by andrewb
We were able to hide those elements using a small script and some CSS.
The script just adds a class to the <body> tag of the page in the iFrame:

Code: Select all

$(function () {
	if (window.self != window.top) {
		$(document.body).addClass("in-iframe");
	}
});
Then the CSS hides elements. You'll likely just have to play around with this to remove the elements that you don't want displayed:

Code: Select all

body.in-iframe .tab-bar,
body.in-iframe .MCBreadcrumbsBox_0,
body.in-iframe .sideContent,
body.in-iframe .sidenav-wrapper,
body.in-iframe .topic-header,
body.in-iframe .TopicToolbar
{
	display: none;
}

Re: Unwanted Navigation Panel Inside the iFrame in the HTML Output

Posted: Wed Aug 07, 2024 7:05 am
by BartoszK
@andrewb
Thanks, this is what I need to achieve: one HTML output without the skin/panels when the file.htm appears in the iFrame.
However, I still have a problem with this solution.

I added the CSS to the default styles.css. Also, I added the JavaScript and referenced it in the file.htm that is supposed to be displayed in the iFrame. That doesn't work, and neither does setting <body class="in-iframe"> directly in the HTML code. The output file, after the build, doesn't have this class assigned. It does work only when I add the body class in the output file, after build.