|
Note: The following tutorial is for users of Macromedia Dreamweaver version 4 or Dreamweaver Ultradev. Templates are a great way to maintain consistency across a website. Static HTML pages have for the most part been edited on a page by page basis - until the advent of Dreamweaver. This tutorial will show how to harness the power of Dreamweaver and create templates and library items which can be replicated sitewide and updated across an entire site. Open up Dreamweaver and start a new page. Before you make any changes, modifications or write any code, save this page as a dreamweaver template. (*.DWT). Add content which you want to be consistent across the whole site, such as a page banner, navigation and anything else. Once created, you can save and close this file and begin working with new documents based upon this template. Editable Regions The reason for these non-editable parts is that they can be updated across all pages which use the template, when changes are made to the template. This really is handy as you dont want to have to trawl through many many pages making slight amendments to content. Creating an editable region is simple. Create a new page from your template (File->New from template), create your content areas which are specific to the page, highlight content in the wysiwyg editing panel that you want to be an editable region and select Modify->Templates->New editable region. If the new editable region is greyed out, make sure you have selected content in the wysiwyg panel, and not the code panel and then retry. Choose a name for the region and click ok. You will notice that the text you have just created is now encapsulated in a small area with the region name at the top left. figure 1 (editable regions, code view) As shown above, editable regions are preceeded by a comment field with #BeginEditable "region-name". Then the content of the editable region is entered and its closed by another comment field which states "#EndEditable". The non-editable parts of the template are highlighted in yellow. These parts will update across pages which use this template, this is why they cannot be changed. In the example above, if you wanted to change the font size in the style declarations to 12pt, you would open the dwt file and change it there. When you save this file a dialog will appear prompting you to update all pages which use the template. Selecting yes will mean the changes will take effect site wide. figure 2 (editable region wysiwyg view)
When you have finished creating your templates and want to update all pages which use the template, you can select Modify->Templates->Update Pages, from the program menus. When pages update, only the content in non-editable regions is updated. Editable regions remain page-specific. Go to: Next page >>>
| Top | Home Remember, if you get stuck or need to ask any questions, register with the forums and tell us about it! |
|