General discussion

Locked

Include a htm page in another htm page

By aweston2 ·
The Frontpage Include component can be used to include a common htm page (e.g. header) inside another htm page. This only works if the included component is in the same Front Page Web. Is there a way a htm page be embedded inside another htm page whatever the URL ?

This conversation is currently closed to new comments.

11 total posts (Page 1 of 2)   01 | 02   Next
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Include a htm page in another htm page

by AlterEgo2 In reply to Include a htm page in ano ...

You could use a javascript 'client-side' include.

<SCRIPT LANGUAGE="JavaScript" type="text/javascript" src="yourfilename.js"></SCRIPT>

Make sure that the include file has a .js extension. The src can be point anywhere.

Hope that does it.

Collapse -

Include a htm page in another htm page

by Shanghai Sam In reply to Include a htm page in ano ...

I could not get this method to work with htm files ?

Collapse -

Include a htm page in another htm page

by Jay Eckles In reply to Include a htm page in ano ...

The suggestion to use SCRIPT for this purpose is a very poor hack. I suggest you use IFRAME or OBJECT, which are the correct elements for embedding objects (including other HTML pages) within an HTML page. An example of IFRAME might be
<iframe src="http://www.yahoo.com" height=150 width=350><!--put alternate content for non-iframe-supporting browsers here--></iframe>
OBJECT is very similar...an example for it might be
<object data="http://www.yahoo.com" type="text/html" height=150 width=350><!--put alternate content for non-object-supporting browsers here--></object>

A good place to go for information about HTML 4.0 is http://www.htmlhelp.com/reference/html40/.

Good luck.

Jay Eckles
www.jayeckles.com

Collapse -

Include a htm page in another htm page

by Shanghai Sam In reply to Include a htm page in ano ...

Thanks for the answer. I tried both methods and they both work but both open a seperate window/frame and any hyperlinks in the new frame are displayed in the new frame not the main frame if you get my meaning. Anyway to avoid this or to redirect thelinks back to the main frame ?

Collapse -

Include a htm page in another htm page

by AlterEgo2 In reply to Include a htm page in ano ...

Can you go into a bit more detail about your page structure and links and end purpose etc.

p.s Poor Hack. lol. Netscape doesn't like IFRAME. Secondly IFRAMES can be a bit of a pain in terms of formatting. Objects.. ah whats the point for a bit ofincluded html..

Collapse -

Include a htm page in another htm page

by aweston2 In reply to Include a htm page in ano ...

I have a number of different webs on a server and want to use a common htm header and footer on all webs. The headers have navigation buttons etc. At present I use the include component (webbot)in Frontpage to reference a common htm file e.g. header.htm for each page I create e.g. <!--webbot bot="Include" U-Include="header.htm" TAG="BODY" -->. The problem is you can't reference an include file outside it's own web so I have to update the file in each of webs everytime I make a change. I would like a common header.htm for all webs but can't find an easy way to do it ? I tried frames and objects and that just confused things as the links in the header where then displayed in that frame etc. Hope this helps explain things ? Any help greatly appreciated. Alan.

Collapse -

Include a htm page in another htm page

by vipulgtyagi In reply to Include a htm page in ano ...

u can use Frames inside html page to show more than 1 html in a page.
<html>
</head></head><body>
<frame id="..." src="name of secondpage. html> </frame>
</body>

Collapse -

Include a htm page in another htm page

by Shanghai Sam In reply to Include a htm page in ano ...

Poster rated this answer

Collapse -

Include a htm page in another htm page

by Jay Eckles In reply to Include a htm page in ano ...

First of all, to the previous poster, you can't put a FRAME element in a document that has a BODY element. A FRAME must be contained within a FRAMESET, and BODY and FRAMESET are mutually exclusive. Just to see if it would work, I tested your code and as I suspected I couldn't get it to work. I think you're probably thinking about IFRAME which can go inside BODY.

Now, to aweston2: I think what you're looking for is SSI (Server Side Include). That would be the "standard" way of doing what your "webbot" does. I put standard in quotes because there's no W3C standard for SSI, but it is commonly implemented by web servers. If you're using Apache, IIS, or any one of several other servers, you can configure SSI. You'll need to check yourserver documentation for how to enable the feature. For a tutorial on how to write SSI directives, try this link:
http://www.wdvl.com/Authoring/Tools/Tutorial/ssi2.html

Please note that there are security concerns with SSI; while it's a useful tool, like any server-side processing you should be wise in how you use it. If you're not the system administrator, you might want to ask the admin about using SSI.

Another solution to what you're trying to do is a template system. There are commercial applications like Teamsite that make management of templates very easy, and I'm sure there are some open-source systems available as well. You should look into them if you have a large collection of templates and websites to manage. It willmake you job much easier.

Good luck.

Jay Eckles
www.jayeckles.com

Collapse -

Include a htm page in another htm page

by Shanghai Sam In reply to Include a htm page in ano ...

Jay

Thanks for the answer, very relevant. I wanted to stay away from using Frames. I will have a look at the link and try out some SSI. What are the security concerns aweston2@csc.com ? I will also look into third party software for managing templates. Many thanks for your help. I have book marked you site.

Alan

Back to Web Development Forum
11 total posts (Page 1 of 2)   01 | 02   Next

Related Discussions

Related Forums