Dreamweaver Using Templates
Dreamweaver topics:
- Dreamweaver Site Setup
- Dreamweaver Text and Links
- Dreamweaver Adding Images
- Dreamweaver Using Styles
- Dreamweaver Using Layers (divs)
- Dreamweaver Using Templates
- Dreamweaver XHTML Code
- Dreamweaver Frames
Contents
Introduction
Usually the layout of a page of your website is shared among several pages. Copying pages and editing them by hand isn't really efficient, especially when you want to change your layout: you'd have to edit all your page manually.
Dreamweaver offers to option to create a template of a specific layout to make it easier to manage and work with your site's layout. You can specify which parts of your layout are fixed (shared among all pages based on the layout), and which parts are filled in uniquely for every page.
creating a Template
The easiest way is to create a template from an existing page. Remove excessive parts that shouldn't be a fixed part of your site's layout template. Then choose File > Save As Template. Template files have the extension .dwt (DreamWeaverTemplate) and are stored in a directory Templates in your Site.
By default, all content of the template are locked when you create a new page from the template. So you need to specify which parts can be edited on every page based on the template.
Select the element (using some 'dummy' text may be useful) that can be changed and choose Insert > Template Objects > Editable Region.
Creating pages based on a Template
Go to File > New and choose the Templates tab. You'll get an overview of all Sites and the Templates for each Site. If you're not using a Site, you can't use templates. Make sure Update page when template changes is checked.
A new page is created. You'll notice that Dreamweaver will only allow you to change the parts that are marked as Editable within the template.
Modifying Templates
In the File Panel, open the Assets tab. Click the Templates icon (second from the bottom). You'll see a list of all templates of your Site (you can refresh the list by right clicking, choosing 'Refresh Site List'). By doubleclicking a Template, the template is opened allowing you to change is. Once you save a modified template, Dreamweaver will ask you whether pages based on this template should be updated.