1. Computing

Discuss in my forum

Jennifer Kyrnin

Use Dreamweaver to share HTML across multiple pages

By September 4, 2006

Follow me on:

One of the most common questions I get is how to share one HTML file in multiple Web pages. For example, if you have a copyright notice that you want on every page of your site, you can either create it and edit it manually every year, or you can use an include system to edit that section of code once and then copy it across the rest of the site. A long time ago, I wrote an article that explained how to share HTML snippets using several technologies like PHP and SSI. But if you don't have PHP or SSI, you can still do it using Dreamweaver.
Comments
September 7, 2006 at 11:45 am
(1) Guy Kantak says:

I’ve never used Dreamweaver, as I’m more of a person who prefers to understand the underlying code. The easiest way I’ve found to do “includes” on pages is through SSI.

For those who are on Unix servers that don’t provide SSI, you can add the following code in a .htaccess file to your main directory to force your regular html pages to behave like shtml (so you can imbed includes):

AddType text/html .html
AddHandler server-parsed .html

Thought this might help some folks.

Peace,
Guy

September 14, 2006 at 11:15 am
(2) Rohan Prabhu says:

Dear Jennifer,
This is rohan prabhu here and i’m an avid reader of all your newsletters. This letter is in reference to your article ‘How to include HTML in other HTML pages’.

Out of the methods you specified, the one with dreamweaver option was the best. The next best option was the usage of a server side component like PHP/CGI. As you might already be knowing, most of the packages available (including phpBB, Drupal etc.) use those methods for their template engines, because it gives an overall generalisation to the site. As for static html pages, it is best to use the features of the IDE (in this case, dreamweaver), because such sites are seldom written using server side scripting. We can also use iframe’s but these are more of a problem than a solution.

As for the javascript method, that is even a poor thing to do, as it not only adds to the problems of the developers, it shredds off accesibility from non-JS browsers. As such there are very few people without JS-enabled browsers, but even then it completely rips off parsers and meta crawlers for example, as they can’t see the HTML equivalent of the webpage.

I hope to hear from your side.

Yours faithfully,
Rohan Prabhu

September 14, 2006 at 1:54 pm
(3) Jennifer Kyrnin says:

Thanks Rohan, You make some good points. I actually don’t prefer one method over any other as there are reasons to use all of them. Using the Dreamweaver IDE is great if you have DW or can afford to buy it. But some people can’t – so other options like JS would be better for them.

Also, I found the DW option to be difficult to maintain with a large Web team all editing Web pages.

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2014 About.com. All rights reserved.