HTML Help
Author
Discussion

grahamdance

Original Poster:

464 posts

267 months

Thursday 23rd March 2006
quotequote all
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!

Plotloss

67,280 posts

300 months

Thursday 23rd March 2006
quotequote all
If I am understanding right google for 'HTML Frames Tutorial'

robbieduncan

1,993 posts

266 months

Thursday 23rd March 2006
quotequote all
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.

Plotloss

67,280 posts

300 months

Thursday 23rd March 2006
quotequote all
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...

grahamdance

Original Poster:

464 posts

267 months

Thursday 23rd March 2006
quotequote all
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?!

slapmatt

1,132 posts

252 months

Thursday 23rd March 2006
quotequote all
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!

J_S_G

6,177 posts

280 months

Friday 24th March 2006
quotequote all
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.