1 / 35

Chapter 12

Chapter 12. Creating and Using Templates. Creating Templates with Editable Regions. 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.

winter
Download Presentation

Chapter 12

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 12 Creating and Using Templates

  2. Creating Templates with Editable Regions • 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.

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

  4. Creating Templates with Editable Regions • 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.

  5. Creating Templates with Editable Regions • 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.

  6. Creating Templates with Editable Regions • 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.

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

  8. Creating Templates with Editable Regions • 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.

  9. Creating Templates with Editable Regions • 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.

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

  11. Using Templates to Create Pages • 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.

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

  13. Using Templates to Create Pages • 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.

  14. Using Templates to Create Pages • 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.

  15. Using Templates to Create Pages • 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.

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

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

  18. Using Templates to Create Pages • 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.

  19. Using Templates to Create Pages • 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.

  20. Using Templates to Create Pages • 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

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

  22. Using Templates to Update a Site • 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.

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

  24. Using Templates to Update a Site • 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.

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

  26. Using Advance Templates • 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.

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

  28. Using Advance Templates • 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.

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

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

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

  32. Using Advance Templates • 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.

  33. Using Advance Templates • 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.

  34. Using Advance Templates Editable Tag Attributes dialog box

  35. Using Advance Templates • 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.

More Related