Link to home
Start Free TrialLog in
Avatar of sandshakimi
sandshakimiFlag for United States of America

asked on

Code once and reuse in Dreamweaver CS5?

I have a static site I'm updating in Dreamweaver CS5, it's all in HTML.

The main menu is coded with a Table element, displayed on over a hundred pages.

I need to add another button to the menu, so I'm considering doing a Find and Replace in one shot.

1) Is that the safest or fastest approach?

2) Anything i can do now to setup the site so I don't have to go through this again? Perhaps a Dreamweaver template or something?
Avatar of Jason C. Levine
Jason C. Levine
Flag of United States of America image

>> 1) Is that the safest or fastest approach?

Assuming your table code is the same on all pages, yes it is safe and reasonable fast.

>> 2) Anything i can do now to setup the site so I don't have to go through this again? Perhaps a Dreamweaver template or something?

If any element is the same on multiple pages, you should consider calling it as an include instead of straight code on all pages.  That way, the element can be updated at a single source and replicated to all target pages.  If you are using PHP or ASP for the site, then this is as simple as:

<?php include('/path/to/htmlsnippet'); ?>

If you are not using server-side scripting on your site, you would want to convert the table to a Dreamweaver Library Item and use that instead of full-blown templates.  

Templates don't work well once you have an existing site as you would have to add the template markup to all of your existing pages.  You can do it, but it is hard.
good answer, just one thing to add...  If you do a "replace all" throughout your site in Dreamweaver, there will be no going back.  I mean no "undo".  Good luck.
ASKER CERTIFIED SOLUTION
Avatar of Jason C. Levine
Jason C. Levine
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