Adobe Dreamweaver CS4 templates are one of the most powerful development aids that the program contains. Basically, a template is a master design which can be copied repeatedly to generate an boundless number of web pages all containing the same shared elements. Unsurprisingly, each time the template generates a new page, the page can be customised and the requisite elements added to it to make it unique. This is achieved by a scheme of locked page regions and editable regions.
When the template is applied to a page, locked regions cannot be modified. (You have to return to the template to adjust them.) Only the areas of the page designated as editable regions can have content added to them.
To create an editable region anywhere on the template, you simply position the cursor in the desired part of the layout and choose Insert – Template Objects – Editable Region. Enter a name for the new region and click OK. One frequent problem experienced by new users of Dreamweaver is the accidental positioning of and editable region inside a heading or paragraph tag. This means that when the template is applied to a page, only text can be placed in the editable region. To fix this problem, return to the template, click in the editable region and examine the Tag Selector on the left of the Status bar. Having located the offending tag (usually h1, h2, p, etc.), right-click on it and choose Remove Tag from the context menu.
To associate an existing page with a template, open the page and choose Modify – Templates – Apply Template to Page. Next, double-click on the name of the template to be applied. Strangely enough, there is no Dreamweaver command that enables you to apply a template to several pages at once. However, here are two suggestions for applying a template to multiple pages reasonably quickly.
Begin by selecting multiple pages in the Files panel using the classic techniques of Shift-click or Control-click (Command-click on a Mac). Then, you can right-click one of the selected files and choose Open from the context menu to open all of them. Next, activate the Assets panel (Window – Assets) and click on the Templates button (the second icon from the bottom). Finally, drag the icon of the required template onto each of the open pages. To speed up the process, use Control-Tab to switch from page to page.
To create a brand new page based on a template, choose New from the File menu and, when the New Document window appears, select the Page From Template option, click on the site that contains the template (It should already be highlighted.), then choose the template. To get the most benefit from a template, before clicking the Create button, make sure that the option “Update Page When Template Changes” is activated.