Basic Idea of a Template
The idea behind a template, as we create earlier in class, is to make it easier to create additional pages. It should help:
- Reduce page development time
- Increase consistency between pages
However, the problem with using a "template" file, renaming it, and adding new content is that it will be difficult to add/remove new pages to the list.
A Dreamweaver Template
Advantages
Dreamweaver has a page type called a template. This works on the same principle as the templates we create, but it has a couple of advantages!
- It tracks all files created from the template
- It allows files to be modified by the template, after they are created
- It allows you to lock down areas so they can't be modified to increase consistency.
How to Make One
- Open your "template" file from before
- Choose the section which will change, delete any filler text
- Insert > Template Objects > Editiable Region
- Save - this will automatically save as a template
To Create File from Template
- File > New
- New Page from Template Tab (far left category)
- Select Site (the site you are in is selected by default)
- Select theTemplate to create the new page from (you should only have one choice in many cases)
- "Create"
- Save your File as an HTML document
Generally you should have only 1 template per site. 2 is acceptable in some cases, but rarely would you have more, unless you have a massive site with lots of different "areas".