270 likes | 414 Views
Unit 8: Using Libraries and Templates. Unit Topics. Site Library Items Creating Site Templates Defining Editable Regions Using Templates Modifying Templates Applying a Template to an Existing Page. Site Library Items. A collection of page elements, text or graphics Library items:
E N D
Unit Topics • Site Library Items • Creating Site Templates • Defining Editable Regions • Using Templates • Modifying Templates • Applying a Template to an Existing Page
Site Library Items • A collection of page elements, text or graphics • Library items: • Are reusable and updateable in one place. • Are ideal for such content as page headers, footers and navigation bars. • Are fully locked and cannot be edited on the pages they are used on.
Storage Location • Library items (.lbi extension) are saved in the \Library folder • Dreamweaver adds the Library folder if it doesn’t already exist • Must always be at the root level
Placing Library Items on the Page • Library content appears highlighted in yellow • You cannot directly edit
Modifying Library Items • To update an item: • Select it from the list of library items • Click Edit • Modify it in the document window • Save • Or edit it within the Property inspector
Immediate Update • Dreamweaver checks all documents that use it and prompts if you want to update the files • Any files not open are updated and saved • Open files are update and not saved
Deferred Update • You may want to update large sites later • Select the item in the Assets panel • Right-click (Windows) or Control-Click (Mac) and choose Update Site • For current page only, choose Update Current Page
Recreating Library Item • If a library item is deleted, you can recreate it in a page: • Select the item in the page • Click Recreate on the Property Inspector
Walkthrough 8-1 • Create and use a Library item
Creating Site Templates • Templates used for large sites with multiple pages that share a common design • Starter page that contains site design • Create site pages from it • Change the look of your site quickly • Possible template elements: • Overall design of the page – with colors, layout and an attached stylesheet • Common navigation items for all pages • Common page regions, such as a common site footer
Template Regions • Templates are created with the following regions: • Editable regions • Optional regions • Repeating regions • Any content not in an editable region is considered locked – cannot edit on any page created by template
Storage Location • Template files (.dwt) stored in \Templates folder • Must be at site root level • Dreamweaver creates the folder
Walkthrough 8-2 • Create a template
Defining Editable Regions • All areas of template are locked by default • Add editable regions • Pages built from a template cannot change locked areas, can edit editable regions
Define Editable Regions • Multiple table cells cannot be designated as a single editable region. • make the entire table editable • break it up into several editable regions • If you select multiple cells within a table and make them editable, the whole table will become an editable region.
Remove Editable Region • Remove an editable region • Region locked for any page based on the template • Select the region and Choose Modify > Templates > Remove Template Markup • If pages based on template already built: • Those regions will be reverted back to the original template content • You will have an option to store the displaced content to another region
Walkthrough 8-3 • Defining editable regions
Using Templates • To use a template: • Choose File New • Click Templates tab • Select the template • Click Create • Finds templatesin any definedsite
Using Templates • Templates from current site only: • Use Assets panel, Templates category, New from Template • Drag a template on top of a new blank document
Walkthrough 8-4 • Creating template pages
Modifying Templates • Edit a template and update all pages • Double-click the template to open it in Assets panel • When you save, Update Template Files dialog appears • Click Update
Walkthrough 8-5 • Modifying a template
Applying a Template to an Existing Page • Apply templates to change design • Open the page and select the template in the Assets panel and then click Apply at the bottom of the panel
Walkthrough 8-6 • Applying a template to a page
Unit Summary • The Library is a collection of page elements that can easily be reused on multiple pages. • Library items can be updated and the changes are applied to all pages that use the library item. • A template can be used to apply the same design to a whole site or set of site pages. • Templates contain editable and locked regions.
Unit Summary • Editable regions can be altered in documents that use the template. • Locked regions cannot be altered in documents that use the template. • Templates can be used to create new pages and can be applied to existing pages.