Discussion
I'm trying to make a website, I've self-taught myself some HTML, enough to get me by
Is there any way to embed a HTML document inside another one?
What I'm trying to do is put a list of links on a number of pages - the links will be the same on each page - but rather than put them in the source on each page, could I "call" another page with them listed on?
i.e. have the code for the links in a file called links.html, and "call" that from the pages index.html, gallery.html, history.html and so on?
I've tried searching on Google but to no avail, its hard enough to describe my problem on here let alone in a search engine!
Is there any way to embed a HTML document inside another one?
What I'm trying to do is put a list of links on a number of pages - the links will be the same on each page - but rather than put them in the source on each page, could I "call" another page with them listed on?
i.e. have the code for the links in a file called links.html, and "call" that from the pages index.html, gallery.html, history.html and so on?
I've tried searching on Google but to no avail, its hard enough to describe my problem on here let alone in a search engine!

robbieduncan said:
Frames are very 1990s and are not favoured any more.
If your server support Server Side Includes you can have each page include the text from another. Very handy for navigation bars etc.
I fully appreciate that, just thought it would be the easiest way for a beginner.
Mind you, easy is a relative term I suppose...
Something along those lines, but rather than have frames I was hoping to just have one line of text appear...
For example, on this page (very old site) the links are in a line near the bottom (between the two HRs). The code for the links is the same on each page - I've just cut and paste it.
What I wanted to do was have the code for the links in a single file, that I refer to from each page.
Not a frame as such, but a similar idea.
Or should I just give up?!
For example, on this page (very old site) the links are in a line near the bottom (between the two HRs). The code for the links is the same on each page - I've just cut and paste it.
What I wanted to do was have the code for the links in a single file, that I refer to from each page.
Not a frame as such, but a similar idea.
Or should I just give up?!
You need to look up Server Side Includes - or SSI.
Don't know how well this'll display, but you can include your links page by using this line:
< ! -- #include virtual="/path/to/your/links.html" -- >
or
< ! -- #include file="links.html" -- >
(you'll need to remove the spaces)
depending on how you do your links.
You might need to rename your parent page to be .shtml rather than .html though in order to get your Web host to pick up on it.
Sorry if that sounds a bit long winded!
Don't know how well this'll display, but you can include your links page by using this line:
< ! -- #include virtual="/path/to/your/links.html" -- >
or
< ! -- #include file="links.html" -- >
(you'll need to remove the spaces)
depending on how you do your links.
You might need to rename your parent page to be .shtml rather than .html though in order to get your Web host to pick up on it.
Sorry if that sounds a bit long winded!
As SlapMatt says, depending on how you're hosting the site, you can do server-side includes. Alternatively, if you get a package like Dreamweaver (www.macromedia.com), it'll let you build templates for pages that drop in such things.
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff


