Link to home
Start Free TrialLog in
Avatar of inthedark
inthedarkFlag for United Kingdom of Great Britain and Northern Ireland

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?

 

Avatar of stu215
stu215
Flag of United States of America image

If you use an application such as Adobe Dreamweaver it offers site management tools which allow you to create library items ( such as a page header / footer / etc ) which you can embed into each page.

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.
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
Avatar of Designbyonyx
Designbyonyx
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of inthedark

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.
Sorry for delay