Forum Moderators: mack
Basically I want to create a common element to all the pages in the site so that if I want to change parts of the navigation bar I only make the change once and a correlative update is made to all of the other pages. Much in the same way that a change to the master CSS file will change the styling of all pages linking to it.
Any help that you could give me would be greatly appreciated.
Cheers
[edited by: engine at 4:39 pm (utc) on April 26, 2006]
[edit reason] TOS [/edit]
First of all, welcome to WebmasterWorld. I hope you find this site useful as you get more web experience.
To do what you want, I would look into Dreamweaver Templates. With a template, you mark off 'editable regions', where the varying content on your pages goes. All of the HTML on your pages that is not part of an editable region will get updated when you change the template.
It wil take a bit of work to set up the first time -- you will need to take one of your existing documents, determine where the variable content is, delete the content, and create an editable region in its place (Insert - Template Object - Editable Region). You can create multiple editable regions if necessary to fit your layout.
Then, save the modified document as a template.
Now, create a new document based on the template you created. Go to the first of your existing documents, and copy the existing variable content to the appropriate editable regions. Then save the new document over the old.
Rinse and repeat for each document that you have.
The end result is that you will now have all your documents under the control of your template. When you change it, DW will ask you if you want to update all your documents to match the template. Say yes, and presto-changeo, they will now contain your modified menu structure.
A better way is through the use of includes. This way, you have a seperate file that contains the code for the navigation area.
This is then 'included' in the page when it is served. Includes are trivial to do with any language, even plain old HTML,.
the advantages of this method is that you then have a single file containing the navigation code. If you need to change it, you change one file, just once, and the changes are truly sitewide.
Includes are pretty much *the* standard way to handle
Makes life *mush* easier!
Includes are pretty much *the* standard way to handle.
They are. But, the various WYSIWYG programs such as Dreamweaver and FrontPage offer proprietary include methods which work just as well. And, if you are working in DW, it is probably going to be much more efficient to work with the tools that the program provides.
Welcome to WebmasterWorld herbert001!