inthedark
asked on
Common content shared between html pages
On a static page site what is the best way of sharing common page areas, say like the page top & bottom, between pages?
A long time in the past I used frames but later found that they were not so good for search engines.
I have also used inline scripting where you set up in each page a link to some common javascript and then with the document body you declare a script section that calls a javascript function pagetop() located in the common scripts.
The pagetop function uses document.write(myhtml) to output the html required for the common areas.
Are there other approaches which are better?
A long time in the past I used frames but later found that they were not so good for search engines.
I have also used inline scripting where you set up in each page a link to some common javascript and then with the document body you declare a script section that calls a javascript function pagetop() located in the common scripts.
The pagetop function uses document.write(myhtml) to output the html required for the common areas.
Are there other approaches which are better?
You can also create page Templates which will allow you to have preset pages for each time you start a new one with all of the header / sidebar / footer content you need there...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the suggestions. If I go the Designbyonyx suggestion and take the php route how can I edit the old MyPage.html page to do a permanent redirect to MyPage.php?
there are a couple of options. The best is probably to use your .htaccess file (google it). You should be able to use the following:
RewriteEngine on
RewriteRule ^(.*)\.html $1\.php
This will redirect everything with an HTML extension to the same file with a PHP extension.
RewriteEngine on
RewriteRule ^(.*)\.html $1\.php
This will redirect everything with an HTML extension to the same file with a PHP extension.
ASKER
Sorry for delay
When you change those items it updates your entire site.
( and all of your pages will be HTML / contain all the code )
Trial version of dreamweaver if you want to try it out:
http://www.adobe.com/cfusion/tdrc/index.cfm?product=dreamweaver
Dreamweaver Features:
http://www.adobe.com/products/dreamweaver/features.html
There are other similar applications which do this but that is my personal favorite for managing sites.