Understanding Library Items

Library items, like templates, provide a method for creating a centralized piece of functionality that multiple pages in your site can use. The major differences between templates and library items, however, is that templates generally represent the overall design of a site. You create one master template file, define editable regions, and then establish pages based on that template (also known as a template-derived page). If changes need to be made to the design of the website, you'd open the template (DWT) file, make the change, save the file, and Dreamweaver updates all the pages based on the template file. In general, the model shown in Figure 15.1 (in the previous chapter) accurately depicts the template-based model.

Library items, on the other hand, aren't meant to control the design of the site as a whole, but rather are meant to define pieces of functionalitysuch as navigation menus, copyright notices, and a company logothat have the potential of changing throughout the context of the site. For instance, assume you have a navigation menu being used by 100 different pages on your site. Also assume that the footer of every page contains a copyright notice complete with a smaller navigation menu that is also being shared by 100 different pages on your site. Now imagine that your supervisor decides to change a link within the navigation menu and to customize the copyright notice to include the current year. Traditional methods would call for the tedious process of opening all 100 pages and making the changes manually. Library items remedy this problem by allowing you to componentize navigation menus, copyright notices, company logos, and so on into one file and then include that file into every page on your website. Later, if changes need to be made, you open the one library item, make the changes, save the file, update the siteand instantly, all 100 pages that use the library item are instantly updated. Figure 16.1 outlines the library item-based model.

Figure 16.1. Library items provide a way to componentize smaller pieces of functionality so that they can easily be shared across the entire site and updated centrally.

Knowing what you know now of library items and templates, there's nothing that would prevent you from using the two together. In fact, templates and library items have the potential for working harmoniously together. For instance, assume that your organization uses the same template for both its intranet and Internet sites. In this case, you would obviously have two navigation menus: one for the public site and one for the intranet site. Rather than creating two different templates, you could use the same template and just create two different library items that represent the two navigation menus. The model outlined in Figure 16.2 describes this scenario.

Figure 16.2. Library items can work with templates in scenarios where you want to use one template in conjunction with multiple navigation menus.

Mirroring the process of templates, as soon as you create a new library item, Dreamweaver automatically creates a Library folder within your defined site and places the library item (LBI) file in that folder. Also similar to templates, library items are centrally managed from the Assets panel, discussed next.

Macromedia Dreamweaver 8 Unleashed
Macromedia Dreamweaver 8 Unleashed
ISBN: 0672327600
EAN: 2147483647
Year: 2005
Pages: 237
Authors: Zak Ruvalcaba

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