Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Linking to common HTML
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Linking to common HTML
Linking to common HTML
04-05-2008 1:11 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I am no expert on this, but I am working on a new website for my archery club, and teaching myself some CSS into the bargain. There is a common chunk of html in all the pages which has the content of a sidebar with the main menu and news headlines. There aren't that many pages, so it is not too big a deal to copy and paste them all when I do an update, but I would like to find some simple way of having one chunk of html that all the pages link to.
I know I could use frames, but I would rather not. I would just like to put a separate small html file into the flow in the same way as you would with an image. Any ideas?
I know I could use frames, but I would rather not. I would just like to put a separate small html file into the flow in the same way as you would with an image. Any ideas?
Message 1 of 7
(1,461 Views)
6 REPLIES 6
Re: Linking to common HTML
04-05-2008 1:36 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
You could use server side includes. You put the common code in a separate file and then where you want it to appear you have
The path is required if the included file is not in the same directory.
The will also need to make additions to .htaccess to tell the webserver which pages should be checked for includes
All my pages which have includes are shtml not html. You could enable it for html but that means it will check for includes on all web pages before they are delivered.
<!--#include virtual="path/includefile.xxx"-->
The path is required if the included file is not in the same directory.
The will also need to make additions to .htaccess to tell the webserver which pages should be checked for includes
AddHandler server-parsed .shtml .htm
AddType text/html shtml htm
All my pages which have includes are shtml not html. You could enable it for html but that means it will check for includes on all web pages before they are delivered.
jelv (a.k.a Spoon Whittler) Why I have left Plusnet (warning: long post!) Broadband: Andrews & Arnold Home::1 (FTTC 80/20) Line rental: Pulse 8 Home Line Rental (£14.40/month) Mobile: iD mobile (£4/month) |
Message 2 of 7
(292 Views)
Re: Linking to common HTML
04-05-2008 8:05 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Thanks, jelv, that looks like the kind of thing I need.
The whole point is that all the pages have the same bit of code, so it will have to check all the pages anyway. I might add this is not hosted by PN, so I guess I'll have to check that the host has that enabled.
The whole point is that all the pages have the same bit of code, so it will have to check all the pages anyway. I might add this is not hosted by PN, so I guess I'll have to check that the host has that enabled.
Message 3 of 7
(292 Views)
Re: Linking to common HTML
04-05-2008 11:54 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
What software are you using as some like MS Expression let you have a master page and all other pages come from that page so if you chamge the master page it changes every page in the site simple.
You can get MS Expression as a free trial
You can get MS Expression as a free trial
Message 4 of 7
(292 Views)
Re: Linking to common HTML
05-05-2008 12:02 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
MS
spit, spit. No, using Suse 10 on a desktop and Ubuntu 7.10 on a lappy. I use Kompozer, but also doing it manually with a text editor.
You would have thought there would be a way of doing it in html, e.g. <html src="xxx.html"> or somesuch, but no, that would be too easy. Server side includes seem to be simple enough, though, unless anyone has any better ideas.

You would have thought there would be a way of doing it in html, e.g. <html src="xxx.html"> or somesuch, but no, that would be too easy. Server side includes seem to be simple enough, though, unless anyone has any better ideas.
Message 5 of 7
(292 Views)
Re: Linking to common HTML
05-05-2008 11:04 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
You could do most of it with CCS as that can handle the menu etc depending what the news is? Using the same CCS for ever page would solve it
Message 6 of 7
(292 Views)
Re: Linking to common HTML
06-05-2008 5:03 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I already have a single styleheet for all the pages. Surely the whole point of CSS is that is does not include content? The style is in the CSS, the content is in the HTML. The content of the common section i.e. link addresses, text etc has to be in the HTML.
Message 7 of 7
(292 Views)
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Linking to common HTML