Reusing Page Elements and Code


Although two projects are never exactly alike, similar page elements or objects often can be applied to multiple sites. For instance, if you develop a script that verifies that the user has completed the required fields of a form, it's likely that you could reuse that same code (with slight modifications, of course) down the road on another project. With that in mind, Macromedia has built several features into Dreamweaver that enable you to save objects and code that can be reused within the same site or on other projects.

In addition, several tools within Dreamweaver help you keep track of your ever-increasing assortment of HTML pages, images, links, color schemes, templates, Flash, and multimedia. As the number of sites that you manage grows, it becomes harder and harder to keep everything organized. Even if you organize your sites well with folders for images, multimedia, and style sheets, you'll soon find the need to add folders for navigational images, movies, or articles relating to a particular section of your site. Navigating to these separate folders time after time during the development process can become tedious and fraught with opportunities for mistakeswhich can lead to broken links.

Links and color schemes present different challenges, of course. These items aren't stored in files, so you can't just navigate the folders of your site to find the link you used on one page or that exact color of blue you used on another. If the same color scheme isn't used from page to page, site consistency is lost. Templates can solve the color consistency issue to some extent, as can Cascading Style Sheets (CSS), but they certainly don't completely solve the problem.

Enter Dreamweaver's Assets panel (see Figure 24.1). Dreamweaver stores every major element of a site in a cache and makes those elements available to every page in the site. The Assets panel is a complement to the Files panel, and therefore they're both docked in the same Files panel group. The Files panel lists the tangible files for the site. The Assets panel lists the intangiblesthe colors, URLs, templates, images, and multimedia used on the site's pages.

Figure 24.1. The Assets panel breaks the site cache into nine categories, each of which can be viewed as a site-wide list or a user-generated favorites list of often-used assets.




Special Edition Using Macromedia Studio 8
Special Edition Using Macromedia Studio 8
ISBN: 0789733854
EAN: 2147483647
Year: 2003
Pages: 337

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net