Dreamweaver in Dreamweaver 4.0, we have contacted the concept of templates and libraries, knowing that they are good tools for generating similar web pages in bulk. Now in Dreamweaver MX (hereinafter referred to as DW MX), the function of template and library is further refined and enhanced, especially to realize the feature of automatic update of related Web pages, making template and library become a bright color of DW mx.
1, first of all, we look at the application of the template, and Dreamweaver 4.0 is different, DW MX to expand the operation of the template to the "Modify" and "Insert" two menus. Also, you can create a template directly in the Assert child option of the "File" option.
2, find the "Assert" sub-option, in the left side of the toolbar click "Templates" button, the template is empty, we can click on the lower right corner of the "New Template" button, a blank template will appear in the panel (see Figure 1), click on the template name, Is that the template enters an editable state. Note that the template does not have any elements added at this time, and we can add tables, images, text, and so on to the template as if we were editing a normal web page. When you have finished adding, save the template, and you can find the template you just made in the Templates subfolder of the default site folder, with the. dwt extension.
If that's the problem, DW MX also provides a more straightforward way to create a template by clicking Save as Templates on the "File" menu after editing the page you want to save as a template.
3, after the template is generated, but also to create an editable region for the future fill in different Web content to prepare. Open the template, click the menu "Insert/template object/editable Region", the Editable Region dialog box appears, and after you specify a range name, you can see a blue box appearing in the template. After you save, you create a template for the editable area.
4. How to generate a lot of Web pages? Click the Menu "File/new", select the "Templates" option, you can immediately see the build template, click the "Create" button, the template will start automatically applied to the page. This time we can see that the original template area is yellow, where the elements have been fixed, can not be edited, and we just specified the editable region is blue, you can edit. In this way, not only greatly simplifies our generation of similar web pages workload, but also effectively ensure the consistency of the Web page style.
5, the last, is the associated web page batch update, this is a large web site to update the Web page is essential to a technology, in the DW MX can be easily realized. Because all of our pages have the same template, and these pages are saved in the same site directory, when we want to make changes to the common elements of all Web pages, just modify the elements in the template.
Open "Templates" child options, double-click the template of the associated Web page, this time the template entered the editable state, the yellow area disappeared, changed the contents of the template, the save will appear a prompt dialog box: "The following pages use the current template, whether to update?" "(Figure 2) Click Update, and all associated pages created on the site based on the template will be updated (Figure 3).
Figure 2
Figure 3
Similar to templates, DW MX Library is more flexible, on the Assert tab, click Library, open the library, there is no element in the library, we put the page to build the library elements, such as tables, images, directly dragged to the library panel (as shown below).
Figure 4
Note that the elements in the library are by no means just images or text itself, but also code that arranges those images in the Web page. As a result, we can also add the same library elements to a Web page, like a template, to produce similar pages in a batch style. At this point, we simply drag the elements back to the new page in the library panel, and the associated code is automatically copied to the new page.
Moreover, the library elements can also achieve the site's bulk update, we click the library elements in the library panel, so that the library into an editable state (Figure 5), when the library elements changed and save, all use of the library elements of the page, will automatically synchronize updates.
Figure 5
Finally, there is a further addition to Automatic Updates: If a Web page is a template generated, but automatically updated to keep it the same, not with the rest of the site to update the page, just click on "Modify/templates/detach from Templates", at this time, This page is no longer subject to template constraints and requires manual ability to update pages.