Forum Moderators: mack

Message Too Old, No Replies

Sitewide Changes

Make changes to all pages within a site

         

herbert001

2:22 pm on Apr 26, 2006 (gmt 0)

10+ Year Member



I've been tasked with creating an extranet; I've been using Dreamweaver 8. Creating a logon system was ridiculously easy and I'm also becoming a dab hand at CSS. But I've no idea how to create a common navigation bar for the whole site. I've tried several searches within Dreamweaver help, Google and the webmastersworld forum but I don’t know the correct terminology for what I want to do.

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]

jonrichd

11:30 pm on Apr 26, 2006 (gmt 0)

10+ Year Member



Herbert,

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.

herbert001

8:32 am on Apr 27, 2006 (gmt 0)

10+ Year Member



Thanks for the reply, and I hope I can help someone out soon to pay back the debt. Ahh Karma..

Thank you.

islandlizard

6:28 pm on Apr 30, 2006 (gmt 0)

10+ Year Member



The method outlined above is 'ok', but not ideal, as the menu area is duplicated in each and every page.

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

  • Headers (i.e. the top section of a site, which usually remains consistent throughout)
  • Footers (the copyright, disclaimer, legal and contact stuff at the bottom)
  • Main Navigation (as this should never change from page to page) and;
  • if necessary, subavigation, which can then be conditionally included depending on the page you are on

Makes life *mush* easier!

herbert001

10:22 am on May 1, 2006 (gmt 0)

10+ Year Member



Again thanks, that sounds much more up my street especialy since I'm trying to make the code as streamlined as possible so if it were needed changes "could" be made using just notepad.

skht

2:17 pm on May 3, 2006 (gmt 0)

10+ Year Member



What about Dreamweaver library items? A little less complicated than templates and easy to change entire site. I use these for navigation and banners, I'm wondering if it's easier or harder than include?

pageoneresults

2:20 pm on May 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



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!

herbert001

4:01 pm on May 3, 2006 (gmt 0)

10+ Year Member



I’ve got to say I never expected so many replies all of which have given me a bit more of an insight. Also making me feel welcome to ask further questions. Thanks guys*

*guys is used in a non gender specific way.