Tamplates
A template is a master document whose design you can apply to multiple pages. Templates allow you to create a page design once, and then create new pages that use that design. When you update the template, Dreamweaver updates all the documents you created based on the template. CSS is particularly in the form of external style sheets that allows you to define a style in a single location and easily reuse that style definition throughout your site but with Dremweaver templates you can easily reuse a page design.
Creating a Template
To create a template, you can begin with a new HTML document, or with an existing web page:
- In an open web page, lay out the design the other pages in your site will use.
- Add the content that you want to remain static across the site.
- Select File --> Save As Template from the Dreamweaver menu bar. In the Save As Template dialog box, Type Home template in the Save As text box, as shown in Figure-4.10 and then click Save.

Figure-4.10
- Look at the Files panel as shown in Figure-4.11. You will see that Dreamweaver has created a new folder called Templates. Double click the folder to see its contents. It contains a new file called Home_tamplate.dwt.

Figure-4.11
- Save your Work.
Editable and Non-Editable Regions
Certain parts of the Template remain non-editable. To control the content of the non-editable regions, you edit the template itself. All other parts of the template are editable. You can alter them as necessary within the page.
Editing Template based Documents
- To edit your Template, double–click the template file Home_template.dwt in the template folder in the files panel or select File --> Open and maneuver to the Template folder for the site.

Figure-4.12
- Place the cursor where you want to insert an editable region. For example, you can click inside a blank area of the page, or you can select a layer or a table cell.
- From the Insert menu, select Template Objects, and then Editable Region.
- The New Editable Region dialog opens as shown in Figure-4.13.

Figure-4.13
- Enter a name for the region and click OK.
- In the menu bar, Select Insert --> Template Objects. This time select Repeating table.
- In the Insert Repeating Table dialog Box, opt for a two-row, two-column table. Type region name cooking as shown in Figure-4.14. Click OK.

Figure-4.14
- Save your work. When you do this, You will be presented with the update Template Files dialog box, which gives the option of updating any pages linked to the template.
- Now switch to the design view. Yow will see the editable regions marked off in the file, as shown in the Figure-4.15.

Figure-4.15
- You can add the text and can also change the formatting to bold and italics by using the property inspector.
- When you've finished defining the editable regions, save the template. If necessary, click Yes to update the links. Preview your work in the browser.
Libraries
Library items are closely related to CSS and templates. A library item consists of Html and a mini template that you can place in any web page in a site. Click on the new Library item button located on the asset panel. It works like template; any change to a library item will propagate throughout the site.

Figure-4.16
Working with Library
- Create an html document.
- Type the words this property belongs to Mr. Andrew. Into the document.
- Select the library category from Assets panel.
- With the text still highlighted, click the New Library Item Button in the Assets panel. You will see the word Untitled appear in the name window as shown in Figure-4.17.

Figure-4.17
- Name your object disclaimer by typing over the word Untitled in the window.
- Close the open document. If you look in the file panel, you will see there has been a library folder created that contains all of your library entries for the site.
- Use this new library item in your page and save your work.