Using IFrames

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
Pamb10
Sr. Propeller Head
Posts: 126
Joined: Wed Feb 01, 2006 2:08 pm
Location: Florida
Contact:

Using IFrames

Post by Pamb10 »

I am attempting to use an iframe to create a list of items on the fly. Someone else maintains this list and I just use the link to display it. However, when using the Iframe code, the style for the topic is altered when the topic is chosen in web help. It looks as if the styles are all stripped from the topic.

Does anyone have any experience using iframes within webhelp?

This is a sample of code that I am using just before the body tag:

<iframe frameborder="0" src="http://www.abc.com/Product_Help/Related ... &Version=9 <http://www.abc.com/Product_Help/Related ... &Version=9" width="100%" height="300" />

The link above will not work as I have altered it for posting purposes.

I am using a default project style file.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Using IFrames

Post by LTinker68 »

You can't have two < and > in the link. Actually, you have two < and one >. You said you altered it, so is the code you posted following the same principal as your real code, or did you alter it too much and inadvertently deleted something?

Also, I think the iframe still needs to be inside the topic's body tag, although I'm not positive about that.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Pamb10
Sr. Propeller Head
Posts: 126
Joined: Wed Feb 01, 2006 2:08 pm
Location: Florida
Contact:

Re: Using IFrames

Post by Pamb10 »

I got that pasted poorly, here is the exact code I am using. It is within the body tags.

<iframe frameborder="0" src="http://webservices.scriptlogic.com/Prod ... &Version=9" width="100%" height="300" />

comparing the generated source to a page with no iframes shows that this part of the header is not injected....hence the missing styles...

<p> </p>
<link href="../../../../SkinSupport/MadCap.css" rel="stylesheet" />
<link href="../../../../Resources/Stylesheets/GeminiiStyles.css" rel="stylesheet" />
<script src="../../../../SkinSupport/MadCapAll.js" type="text/javascript">
</script>


As well, the breadcrumb code is not injected...

<div class="MCBreadcrumbsBox"><span class="MCBreadcrumbsPrefix">You are here: </span><a class="MCBreadcrumbsLink" href="../../../../help_index.htm">Administrator's Guide</a><span class="MCBreadcrumbsDivider"> > </span><a class="MCBreadcrumbsLink" href="../profilesettings.htm">User Management</a><span class="MCBreadcrumbsDivider"> > </span><span class="MCBreadcrumbs">Display</span>
</div>
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Using IFrames

Post by LTinker68 »

Does it work if you insert the iframe code after the opening <body> tag in the topic? If you're using a masterpage, then I think everything inside the bodyProxy is everything between the <body> ... </body> tags, and putting something in front of the opening <body> tag may screw up the masterpage build process.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Pamb10
Sr. Propeller Head
Posts: 126
Joined: Wed Feb 01, 2006 2:08 pm
Location: Florida
Contact:

Re: Using IFrames

Post by Pamb10 »

No, the iframe is just before the </body> tag.

I did just test with the iframe code, just following the <body> tag....that also strips the breadcrumbs and styles as well as any text following the iframe...

:(
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Using IFrames

Post by LTinker68 »

Hmmm. You're checking it in the output, right, not just the XML Editor or Preview window?

If it doesn't work correctly in the output then I'll have to bump to someone else to see if they've used iframes with Flare before.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Pamb10
Sr. Propeller Head
Posts: 126
Joined: Wed Feb 01, 2006 2:08 pm
Location: Florida
Contact:

Re: Using IFrames

Post by Pamb10 »

Yes in the generated output. :)

Anyone else have any ideas?
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Using IFrames

Post by NorthEast »

I tried your iframe code, and get an error message when I save the topic: "... contains invalid XML, '=' is an unexpected token..."
That probably explains why that topic doesn't build properly.

I use iframes myself and have no problems, although I don't use parameters in my URLs.
Pamb10
Sr. Propeller Head
Posts: 126
Joined: Wed Feb 01, 2006 2:08 pm
Location: Florida
Contact:

Re: Using IFrames

Post by Pamb10 »

Yes I know it gives an error when its saving, but it does get saved. I've seen another message on the forum to that type of error and it works fine once it is generated.

The code I am using works fine outside of Flare so I know the code is correct.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Using IFrames

Post by NorthEast »

Well, you can ignore the error message if you like; but it's telling you Flare doesn't like the code, and that's why it isn't building the topic properly.

Using your code, if I open the source topic in a browser, the iframe doesn't display at all.

The iframe does display (in a browser) if I change your code to use a closing </iframe> tag, instead of the /> you've used.
So, I would guess that the closing tag may be required for XHTML; you may get different results if you were testing it as HTML rather than XHTML.

Anyway, this change made it work in the built output too.

Flare still complains about the = in the iframe URL. Perhaps contact MadCap support to see if this is a known bug, or whether you need to format the iframe URL differently so that it is valid for Flare.
Pamb10
Sr. Propeller Head
Posts: 126
Joined: Wed Feb 01, 2006 2:08 pm
Location: Florida
Contact:

Re: Using IFrames

Post by Pamb10 »

Yes the code works but it generates incorrectly as the style file and breadcrumb code are not generated, hence not showing in the final output.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Using IFrames

Post by NorthEast »

Pamb10 wrote:Yes the code works but it generates incorrectly as the style file and breadcrumb code are not generated, hence not showing in the final output.
I'm not sure what "the code works" means, if you're saying the topic isn't generated properly in the output.

Your code generates for me ok, if I include the closing </iframe> tag, although the editor still complains about the = sign in the URL. Flare seems to report an error for any URL that contains a parameter (e.g. try an iframe that links to this topic).

Like I said, if you contact MadCap support, they might be able to give advice on using iframes.
Pamb10
Sr. Propeller Head
Posts: 126
Joined: Wed Feb 01, 2006 2:08 pm
Location: Florida
Contact:

Re: Using IFrames

Post by Pamb10 »

Yes i do plan on getting in touch with support.

By saying the code works, i mean that the frame is correct, but the topic has not style file applied or breadcrumb.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Using IFrames

Post by LTinker68 »

I wonder if the iframe is pulling styles from the site you're referencing? Even then I wouldn't expect it to be a problem unless that site happens to have styles with the same names (namely the breadcrumb-related styles). Some of the common styles (h1, p, body) could possibly be overridden by the iframe's styles. Of course, if your breadcrumb-related styles are inheriting styles then the iframe might be causing that problem.

I've never really looked up the rules for using iframes, if it will indeed load that content's stylesheet, thereby overriding the main content's stylesheet. To test it, give one of your breadcrumb-related classes a funky background or text color and see if that comes through. Or create a span or generic class with a really off-the-wall name, give it a funky text color, and apply it to some of your text and see if it's retained in the output.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Using IFrames

Post by NorthEast »

Pamb10 wrote:Yes i do plan on getting in touch with support.

By saying the code works, i mean that the frame is correct, but the topic has not style file applied or breadcrumb.
Ok, I found that using a /> on the iframe tag causes all the page content after the iframe to disappear (the code was present in the file, it was just not displayed).
Using a closing </iframe> tag instead caused all the remaining page content to be displayed fine (including breadcrumbs) - so I seem to be getting different results to you.
However, the Flare editor still reports an error, and considers it to be an invalid XML file (which will probably also cause issues with how the file is processed, e.g. cross-references to the file may not be resolved).

Also, if you're expecting the iframe content itself to use the stylesheet of the parent topic, then it won't inherit the styles; the iframe topic will need its own stylesheet link.
Pamb10
Sr. Propeller Head
Posts: 126
Joined: Wed Feb 01, 2006 2:08 pm
Location: Florida
Contact:

Re: Using IFrames

Post by Pamb10 »

ok, you guys are gonna love this one. im posting this so someone searching in the future will know the correct action to take.

My problem was occurring because of the use of the & in the URL:

Code: Select all

http://www.abc.com/Product_Help/Related_Article/default.asp?ObjectName=test&Version=9
I replaced the & with & and it now saves and generates perfectly!
Post Reply