Intermediate Dreamweaver

Topics:

 

Templates

Templates

Templates are specialized files that have the design of your web page set up on them. Parts that you don't want to change from one page to the next are marked as 'not editable'; parts that you do want to change are 'editable'. When you want to create a new document of that format, you choose 'New From Template' and select the template, then edit the material in the editable regions. When you make changes to the template, Dreamweaver will duplicate them on all the pages using that template.

Create the template

  • Start with a page that has the layout you want and delete the content in areas that will change, or create a new page, leaving the content areas blank.
  • Save the page as a template: choose Save As Template from the File menu Save in File menu
  • In the Save As Template Dialog box that comes up, Save as Template Dialog Box
    select the Site you want the template for, then in the Save As dialog box, enter a name for the Template (this will become the filename of the template as well).Click Save to complete the save operation.
  • Insert editable areas in the template:
    • click where you want the area to be
    • From the Modify menu, choose Templates, then New Editable Region Menu: Templates, New Editable Region
    • Enter a name for the region:
      Name for the Region
    • The region will be displayed as text in curly brackets with a blue box around it and a blue tab showing the name.
      The text can be changed to indicate what content should be inserted in the region.
    • Repeat as necessary for all the editable regions you want to create.
  • Save again.

Note: when putting a link to a particular page into a template, it's best to use a fully-qualified (http://...) address for that link. Otherwise, you may need to copy the files into the template file to have the links work properly. Graphics used in the Template should appear both in the Template folder and in the root folder of the website.

Create new pages from the template:

  • from the File Menu, choose 'New From Template'.File: New from Template
  • Go to each editable region, select the text in it, and type or paste the content you want to appear there on the page you are working on: Editable region example
  • Once you have filled in all the Editable regions with their appropriate content (or deleted the text if you are not going put content in them), save the page in the Site folder

Repeat for all the pages you want to use that template. (Note: the pages do NOT have to have access to the template when uploaded.

Editing the Template

  • To make changes to the template, open it, make changes, save it and when asked if you want to make the changes to all pages using this template, say yes. Dreamweaver will display a screen showing the pages being updated.

Notes about Templates: Templates are associated with Sites. However, Site setup does not migrate with the LAN space but has to be set up for each computer you use Dreamweaver. Templates are saved in directories with the site. So, if you put the directory you are working with in your LAN space, once you set up the Site on a computer with access to the LAN space, you will be able to use the Templates.

Adding updating dates via the template

You can combine the editable region and the date functionality to set up pages to have a last updated date that automatically updates itself whenever that particular page is updated.

  1. Insert a editable region where you want the date to appear.
  2. With the cursor in the editable region, choose Date from the Insert menu.
  3. Choose a date format, and make sure that 'Update Automatically on Save' is checked.
  4. Click OK.

Last Modified: November 18, 2002