Bài giảng Thiết kế web Dreamweaver CS4 - Chapter 4 introduce templates. This chapter presents content: Template basics, creating a template, defining editable regions, repeating region, adding a repeating region,...and another content.
Templates Template Basics Template: let you build pages that share a similar structure and graphic identity A new page based on a template, called a template instance, you can edit only certain areas of the page, called an editable regions A Dreamweaver template can be very basic: one or more areas of a page (the editable regions) can be changed on pages built from the template, others can’t (the locked regions) Creating a Template Turning a Web Page into a Template: The easiest way to create a template is base on a Web page in your current site folder – You may run into problems with links and paths to images, as described in a moment – File ➝ Save As Template, template page is saved in the Templates folder – It adds the extension dwt Creating a Template Building a Template from Scratch: – Window ➝ Assets and then click the Template assets icon, then click the New – Type a new name for template – After you’ve created a blank template for the site, you can open it by double-clicking its name in the Assets panel – It opens just like any Web page, so that you can get busy designing it Creating a Template Defining Editable Regions By default, everything on a page is locked To make a template usable, you must define the area or areas you can change – Selecting the part of the page you want to make changeable – In the Common category of the Insert panel select Editable Region from the Template menu – Insert ➝ Template Objects ➝ Editable Region – Type a name for the region click OK Repeating Region Some Web pages contain lists of items If you were to make a template for either of these pages, you would add an editable region to the area of the page where these lists appear Just creating an editable region However, wouldn’t give you any ability to enforce (or easily update) the design of these lists, because everything within an editable region can be changed Repeating Region Dreamweaver provides two tools to resolution this problems are: • Repeating regions • Repeating tables Both let you create areas of a page that include editable regions that can be repeated any number of times Adding a Repeating Region Select the area of the template page you wish to make repeatable This area usually contains at least one editable region: single list item (the