Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 12 Creating and Using Templates. If you have already created and designed a page you like, you can use the layout and design for other pages in.

Similar presentations


Presentation on theme: "Chapter 12 Creating and Using Templates. If you have already created and designed a page you like, you can use the layout and design for other pages in."— Presentation transcript:

1 Chapter 12 Creating and Using Templates

2 If you have already created and designed a page you like, you can use the layout and design for other pages in your site, and save the page as a template. Creating Templates with Editable Regions

3 Template in Assets panel Assets panel Templates button Preview of selected template List of templates available in this site Creating Templates with Editable Regions

4 Templates are saved with a.dwt extension and are stored in the Templates folder in the site root folder for your website. If your site does not have a Templates folder, Dreamweaver automatically creates one for you. Creating Templates with Editable Regions

5 By default, when you save a template, all content on the page is locked. No one else can add content or modify any part of the template to create new pages. Creating Templates with Editable Regions

6 If your template is going to be used effectively, you must have at least one editable region in it so that other users can add content. Creating Templates with Editable Regions

7 Template with locked and editable regions Editable region label (all other regions are locked) Blue outlines of editable region Creating Templates with Editable Regions

8 You can also add optional regions to a template, which is an area in a template that users can choose to either show or hide. An optional region’s visibility is controlled by the conditional statement if. Creating Templates with Editable Regions

9 If you want to give users the ability to show or hide a page element, as well as make modifications to it, then you can define the element as an editable optional region. Creating Templates with Editable Regions

10 New Editable Region dialog box Name of new editable region Creating Templates with Editable Regions

11 There are many advantages to using a template to create a page: – First, it saves time, because part of the content and format of your page is already set. – Second, it ensures that the page you create matches the look and format of other pages. Using Templates to Create Pages

12 Working with a template-based page Pointer positioned over a locked region Notation that this page is based on the activities_pages template Using Templates to Create Pages

13 When you create a new page that is based on a template, certain areas of the new page are locked. When a mouse pointer is positioned over a locked region, it appears as a circle with a line cutting through it. Using Templates to Create Pages

14 To edit, delete, or add content in editable regions of a template-based page: – You can select the element you want to modify and make the changes. – You can click in the editable region and insert the new content. Using Templates to Create Pages

15 When you add a link to a page that is based on a template, it is important to use document relative links; otherwise, they will not work. Using Templates to Create Pages

16 Using the Point to File icon to specify a document-relative link Point to File icon Using Templates to Create Pages

17 The path to a link actually goes from the template file (not from the template-based page) to the linked page. Using Templates to Create Pages

18 To ensure that all links are document-relative, you should: – select the page element to which you want to add a link. – drag the Point to File icon from the Property inspector to the page in the Files panel. Using Templates to Create Pages

19 Sometimes you need to apply a template to a page that you have already created. If so then before you attach a template to an existing page, you should delete any elements from the page that also appears in the template. Using Templates to Create Pages

20 If you want to detach a template from a page: – first open the page you want to detach from the template – Click Modify on the Menu bar – point to Templates – click Detach from Template Using Templates to Create Pages

21 New fishing page based on a template Using Templates to Create Pages

22 A good website should be updated frequently to keep the content fresh and timely. If your websites are based on templates, than it will be much easier to make changes to your sites. Using Templates to Update a Site

23 Update Template Files dialog box Files based on activities_pages template Using Templates to Update a Site

24 One of the greatest benefits of working with templates is that any change you make to a template can be made automatically to all nested templates and pages that are based on the template. Using Templates to Update a Site

25 A nested template is a template based on an existing template, called a root template. Using Templates to Update a Site

26 If your template will be used by many people, it might be a good idea to include several optional regions in it so that template users can pick and choose from a wide range of content elements. Using Advance Templates

27 You might also want to set parameters for optional regions, specifying that they are displayed or hidden based on specific conditions. Using Advance Templates

28 If you are working on a complex website that has many different pages used by different people or departments, you might need to create nested templates, which are templates that are based on another template. Using Advance Templates

29 Nested templates are helpful when you want to define a page or parts of a page in greater detail. Using Advance Templates

30 An advantage of using nested templates is that any changes made to the original template can be automatically updated in the nested template. Using Advance Templates

31 Editable regions in the original template are passed on as editable regions to the nested template. Using Advance Templates

32 However, if you add a new editable or optional region to an editable region that was passed on from the original template, the original editable region changes to a locked region in the nested template. Using Advance Templates

33 There might be times when you want users of your template to be able to change certain attributes of an element in a locked region. You can use the Editable Tag Attributes to change attributes. Using Advance Templates

34 Editable Tag Attributes dialog box Using Advance Templates

35 When you define editable attributes of elements in locked regions, template users can make changes to the element’s attributes using the Template Properties dialog box. Using Advance Templates


Download ppt "Chapter 12 Creating and Using Templates. If you have already created and designed a page you like, you can use the layout and design for other pages in."

Similar presentations


Ads by Google