Presentation is loading. Please wait.

Presentation is loading. Please wait.

Using Templates and Library Items

Similar presentations


Presentation on theme: "Using Templates and Library Items"— Presentation transcript:

1

2 Using Templates and Library Items
DREAMWEAVER MX 2004 Chapter 8 Using Templates and Library Items Copyright 2005, Paradigm Publishing Inc.

3 Performance Objectives
Understand how template and library items work. Create templates from new and existing documents. Insert editable regions, repeating regions, and repeating table regions into templates. Create new documents from templates. Attach existing documents to templates. Create editable tag attributes. Copyright 2005, Paradigm Publishing Inc.

4 Performance Objectives…/2
Create nested templates. Update templates and documents created from templates. Set template preferences. Create library items. Insert library items into documents. Edit library items. Copyright 2005, Paradigm Publishing Inc.

5 Understanding Templates
A template is a document used as a pattern to create other documents. The predefined page-design documents function as templates. Dreamweaver MX 2004 templates contain locked regions. When a document is created the entire document is locked with the exception of the document title. After the template is created, users must designate regions of the document that will be editable. Copyright 2005, Paradigm Publishing Inc.

6 Understanding Templates…/2
HTML documents created from a template are attached to the template and contain locked and editable regions. prohibited sign indicating locked region editable region Copyright 2005, Paradigm Publishing Inc.

7 Understanding Templates…/3
Editable regions are indicated by a colored tab containing the name of the editable region. An outlined rectangle indicates the region of the document that can be edited. Positioning the insertion point inside the rectangle allows users to enter content in the normal fashion. The pointer turns into a prohibited sign when it moves over a locked region. Copyright 2005, Paradigm Publishing Inc.

8 Understanding Templates…/4
When a document is created from a template, it is automatically attached to the template. Documents created from a template are called instances. Instances can be saved as templates or as HTML documents. Changes made to any of the locked regions or the addition of new editable regions will be propagated to any document created using the template. Copyright 2005, Paradigm Publishing Inc.

9 Creating Templates Templates may be created from a new blank HTML document or by using an existing document. It is a good idea to create placeholder text that lets users know the purpose of an editable region. placeholder text Copyright 2005, Paradigm Publishing Inc.

10 Creating Templates…/2 When templates are created, a new Templates folder will be created. The Templates folder will be stored in the root folder of the current site, unless another site is chosen. The Templates folder should not be moved and templates should not be moved out of the Templates folder. Copyright 2005, Paradigm Publishing Inc.

11 Creating Templates…/3 Template names have a .dwt file extension.
Names should be lowercase and should not contain special characters or spaces. Hyphens or underscores can be used to separate words. template files Copyright 2005, Paradigm Publishing Inc.

12 Creating Templates…/4  
Templates can be created from scratch by opening a basic HTML document and then saving. click File click Save as Template Copyright 2005, Paradigm Publishing Inc.

13 Creating Templates…/5 During the saving process, a message box appears advising that the document does not contain editable regions. You can save a document without editable regions. Copyright 2005, Paradigm Publishing Inc.

14 Creating Templates Using the Assets Panel
click Window click Assets Copyright 2005, Paradigm Publishing Inc.

15 Creating Templates Using the Assets Panel…/2
click the Templates button click the New Template button Copyright 2005, Paradigm Publishing Inc.

16 Creating Templates Using the Insert Bar
click the Templates button down-pointing arrow click Make Template Copyright 2005, Paradigm Publishing Inc.

17 Creating Templates from an Existing Document
Creating a template from an existing document is the same as creating a template from a new document. The only exception is that you can select existing content and make it editable while leaving other content locked. The existing HTML document is transformed into a template by using the Save as Template command. Copyright 2005, Paradigm Publishing Inc.

18 Creating Editable Regions
You should designate at least one editable region in the document. Four types of regions can be created in a template: editable regions repeating regions repeating tables optional regions Optional regions appear or do not appear based on conditional statements. Creating the conditional statements requires writing expressions. Copyright 2005, Paradigm Publishing Inc.

19 Editable Regions An editable region can be edited in documents created from a template. If an editable region is inserted in a normal HTML document, a message appears. Copyright 2005, Paradigm Publishing Inc.

20 Editable Regions…/2 The placement of the editable region in selected page content is important. If you want users to be able to create new block elements, the editable region must be placed outside the block tags. If you place an editable region inside block element tags, a message will appear. Copyright 2005, Paradigm Publishing Inc.

21 editable region inside block tags editable region outside block tags
Editable Regions…/3 Switching to Code view will reveal whether an editable region is contained inside or outside paired block tags. editable region inside block tags editable region outside block tags Copyright 2005, Paradigm Publishing Inc.

22 Inserting Editable Regions
Position the insertion point in the desired location or select page content. click Insert point to Template Objects click Editable Region Copyright 2005, Paradigm Publishing Inc.

23 Inserting Editable Regions…/2
The New Editable Region dialog box appears prompting you to create a name. Editable region names should be lowercase and contain no spaces or special characters. Hyphens or underscores can be used to separate words. Copyright 2005, Paradigm Publishing Inc.

24 Inserting Editable Regions…/3
If page content was selected when creating the editable region, it will appear inside the editable region box. If no page content was selected, the name of the editable region will appear inside the editable region box. editable region created with placeholder text editable region created without placeholder text Copyright 2005, Paradigm Publishing Inc.

25 Removing Editable Regions
First, select the region. click Modify point to Templates click Remove Template Markup Copyright 2005, Paradigm Publishing Inc.

26 Repeating Regions Repeating regions allow you to repeat a region simply by clicking the Plus (+) button. Plus button Minus button Down Arrow and Up Arrow buttons Copyright 2005, Paradigm Publishing Inc.

27 Repeating Regions…/2 The repeated region can be removed by clicking the Minus (-) button. The Up Arrow and Down Arrow buttons can be used to change the order of the repeated regions. A repeating region is not editable unless it has been specifically designated as a repeating region. Copyright 2005, Paradigm Publishing Inc.

28 Creating Repeating Regions
click Insert point to Template Objects click Repeating Region Copyright 2005, Paradigm Publishing Inc.

29 Repeating Tables Repeating tables allow you to define the rows of a table that will repeat when the Plus (+) button is clicked. click Insert point to Template Objects click Repeating Table Copyright 2005, Paradigm Publishing Inc.

30 Repeating Tables…/2 The Insert Repeating Table dialog box appears.
Enter the appropriate values and choices. The repeating rows are created automatically as editable regions. Copyright 2005, Paradigm Publishing Inc.

31 Attaching a New Document to a Template
A document must be attached to a template to take advantage of the power that templates have to offer. click the Templates button right-click a template name and then click New from Template Copyright 2005, Paradigm Publishing Inc.

32 Attaching a New Document to a Template Using the Menu Bar
click File click New click the Templates tab Copyright 2005, Paradigm Publishing Inc.

33 Attaching a Template to an Existing Document
click Modify point to Templates click Apply Template to Page Copyright 2005, Paradigm Publishing Inc.

34 Attaching a Template to an Existing Document…/2
The Select Template dialog box opens. Select the site that the template is located in, and click a template name. Copyright 2005, Paradigm Publishing Inc.

35 Inconsistent Region Names
An Inconsistent Region Names dialog box might appear. The purpose of this dialog box is to resolve the regions in the current document with the regions in the template it was attached to. This can happen either when a document without any editable regions is attached to a template or when a document contains regions whose names differ from the regions in the new template being attached. Copyright 2005, Paradigm Publishing Inc.

36 Inconsistent Region Names…/2
region in current document that differs from regions in template being added editable regions from template to be applied to document Nowhere discards the unresolved region selected in list box Copyright 2005, Paradigm Publishing Inc.

37 Creating Editable Tag Attributes
It is possible to allow users to change selected attributes of text or page content that are otherwise locked. For example, an image could be locked, but specified image attributes such as border, width, height, or align could be made into editable tag attributes. To modify an attribute, you must select the desired page content. Copyright 2005, Paradigm Publishing Inc.

38 Creating Editable Tag Attributes…/2
click Modify point to Templates click Make Attribute Editable Copyright 2005, Paradigm Publishing Inc.

39 Creating Editable Tag Attributes…/3
The Editable Tag Attributes dialog box opens. Copyright 2005, Paradigm Publishing Inc.

40 Editable Tag Attributes Dialog Box
To make an attribute editable, click the Make attribute editable check box. The Label text box should be used to create a new distinctive name for the attribute. The Type list box lets you specify the type of value than can be entered. The Default text box displays the current default value for the current attribute. Copyright 2005, Paradigm Publishing Inc.

41 Adding Attributes Clicking the Add button allows you to add an attribute to the list. You can use the Reference panel to see the attributes that can be used with a particular tag. selected HTML tag attributes that can be used with the selected HTML tag Copyright 2005, Paradigm Publishing Inc.

42 Editing Attributes Locked content with one or more editable attributes can be edited. click Modify click Template Properties Copyright 2005, Paradigm Publishing Inc.

43 current attribute value
Editing Attributes…/2 The Template Properties dialog box opens. current attribute value attributes that can be edited in current document new attribute value can be entered here Copyright 2005, Paradigm Publishing Inc.

44 Creating Nested Templates
Templates can be nested inside other templates to offer more control over editable content and to streamline the page-design process. An instance can be created from the parent template and additional content can be added to the editable region. A new editable region can be inserted. The instance can be saved as a template. Dreamweaver MX 2004 automatically makes this template a nested template of the parent template. Copyright 2005, Paradigm Publishing Inc.

45 Creating Nested Templates…/2
An instance can be created based on the nested template. A new editable region can be inserted. Using the Save as Template command will save this instance as a nested template of the first nested template. All of the content inherited from the parent template and the first nested template will be locked in this second nested template. The only editable region will be the one inserted when this template was created. Copyright 2005, Paradigm Publishing Inc.

46 Creating Nested Templates…/3
Nested templates can be created by opening the Assets panel. click the Templates button right-click a template name click New from Template Copyright 2005, Paradigm Publishing Inc.

47 Updating Template-Based Documents
When a template is updated, you can decide whether you want templates attached to the template to be updated as well. When changes are made and a template is saved, an Update Template Files dialog box appears. Copyright 2005, Paradigm Publishing Inc.

48 Updating Template-Based Documents…/2
After updating the documents, an Update Pages dialog box appears displaying the results of the updating process. Copyright 2005, Paradigm Publishing Inc.

49 Updating Template-Based Documents…/3
Template changes can be propagated to documents attached to the template on an individual basis. click Modify point to Templates click Update Current Page Copyright 2005, Paradigm Publishing Inc.

50 Updating Template-Based Documents…/4
Template changes can be applied to some templates and not others. click Modify point to Templates click Update Pages Copyright 2005, Paradigm Publishing Inc.

51 Updating Template-Based Documents…/5
You also can open a document and then open the template it is attached to. click Modify point to Templates click Open Attached Template Copyright 2005, Paradigm Publishing Inc.

52 Detaching Templates from Documents
A detached document retains its template content but is no longer updatable. click Modify point to Templates click Detach from Template Copyright 2005, Paradigm Publishing Inc.

53 Creating Links in Templates
When a template is created from an existing document containing document-relative links, Dreamweaver MX 2004 must update the links because the template document will be saved in the Templates folder. Links in template files should be created using the Point to File or Browse for File buttons. The only exception would be for external URLs, which must be typed in the Link text box. Copyright 2005, Paradigm Publishing Inc.

54 Setting Template Preferences
The colors used to highlight the outlines for editable and locked regions can be changed. click Edit click Preferences Copyright 2005, Paradigm Publishing Inc.

55 Setting Template Preferences…/2
The Preferences dialog box opens. Clicking the appropriate color box opens the Color Picker and the Eyedropper can be used to selected the desired color. click Highlighting template color preferences Copyright 2005, Paradigm Publishing Inc.

56 Understanding Library Items
Library items are sections of code that can be created, saved, and then inserted in documents whenever needed. When a library item is updated, the changes are propagated to every copy of the library item that was inserted in any document in a site. Library items are not limited to text. They can be images, tables, URLs, or any type of content that might be found in an HTML document. Copyright 2005, Paradigm Publishing Inc.

57 Understanding Library Items…/2
When a library item is created in a site for the first time, Dreamweaver MX 2004 creates a Library folder to store all of the library items in that site. Library items are assigned with an .lbi file extension. Library folder library items Copyright 2005, Paradigm Publishing Inc.

58 Understanding Library Items…/3
Library items in one site will not be accessible to other sites. A Library folder from one site can be copied to another site. Links in library items might not work if the library item is moved to another site. Any images in library items must be copied to the new site for those library items to work. Copyright 2005, Paradigm Publishing Inc.

59 Creating Library Items
The first step is to select the page content that is to be saved as a library item. click Modify point to Library click Add Object to Library Copyright 2005, Paradigm Publishing Inc.

60 Creating Library Items…/2
The Assets panel opens and displays the new library item listing. The default library item name is highlighted, and a new name can be typed. library catalog indicator new library item ready for naming Copyright 2005, Paradigm Publishing Inc.

61 Creating Library Items…/3
New library items also can be created by dragging selected content into the Library category of the Assets panel. Another method is to select the content and then click the New Library Item button at the bottom of the Assets panel. Copyright 2005, Paradigm Publishing Inc.

62 Adding Library Items to Documents
Position the insertion point in the desired location and then drag the library item into the Document window. You also can click the library item in the Assets panel and then click the Insert button. Insert button Copyright 2005, Paradigm Publishing Inc.

63 Adding Library Items to Documents…/2
Most library items appear shaded in light yellow when they are inserted into a document. The highlighting color can be changed in the Preferences dialog box. library item Copyright 2005, Paradigm Publishing Inc.

64 Editing Library Items Library items can be edited by double-clicking the library item in the Assets panel or by clicking it and then clicking the Edit button at the bottom of the panel. You also can open a library item file by selecting it and then clicking the Open button in the Library Item Property inspector. Open button Copyright 2005, Paradigm Publishing Inc.

65 Editing Library Items…/2
Changes can be made to the library item once the library item file is the current document. If the library item has not been inserted in a document, it will be saved. If it has been inserted, the Update Library Items dialog box will open. copy of library item to be updated in this document Copyright 2005, Paradigm Publishing Inc.

66 Editing Library Items…/3
The current document in the Document window can be updated. click Modify point to Library click Update Current Page Copyright 2005, Paradigm Publishing Inc.

67 Editing Library Items…/4
All documents in a site or all of the documents that use a library item can be updated. click Modify point to Library click Update Pages Copyright 2005, Paradigm Publishing Inc.

68 Editing Library Items…/5
The Update Pages dialog box opens. library items will be updated in all files in this site Copyright 2005, Paradigm Publishing Inc.

69 Editing Library Items…/6
After updating the documents, an Update Pages dialog box appears displaying the results of the updating process. Copyright 2005, Paradigm Publishing Inc.

70 Deleting Library Items
To delete a library item, click it and then press the Delete key. You can also delete a selected library item by clicking the Trash Can button in the Assets panel. Deleting a library item does not remove any copies of the item that have been inserted in documents. Copies can no longer be updated. Copyright 2005, Paradigm Publishing Inc.

71 Restoring Library Items
You can restore a deleted library item by selecting a copy that has been inserted in a document and then clicking the Recreate button in the Library Item Property inspector. Recreate button Copyright 2005, Paradigm Publishing Inc.

72 COMMANDS REVIEW How do you attach a template to an existing document? click Modify point to Templates click Apply Template to Page Copyright 2005, Paradigm Publishing Inc.

73 COMMANDS REVIEW…/2    How do you create a library item?
click Modify point to Library click Add Object to Library Copyright 2005, Paradigm Publishing Inc.

74 COMMANDS REVIEW…/3    How do you create a new template instance?
click File click New click the Templates tab Copyright 2005, Paradigm Publishing Inc.

75 COMMANDS REVIEW…/4    How do you create an editable tag attribute?
click Modify point to Templates click Make Attribute Editable Copyright 2005, Paradigm Publishing Inc.

76 COMMANDS REVIEW…/5    How do you detach a template from a document?
click Modify point to Templates click Detach from Template Copyright 2005, Paradigm Publishing Inc.

77 COMMANDS REVIEW…/6    How do you insert a repeating region?
click Insert point to Template Objects click Repeating Region Copyright 2005, Paradigm Publishing Inc.

78 COMMANDS REVIEW…/7    How do you insert a repeating table?
click Insert point to Template Objects click Repeating Table Copyright 2005, Paradigm Publishing Inc.

79 COMMANDS REVIEW…/8    How do you insert an editable region?
click Insert point to Template Objects click Editable Region Copyright 2005, Paradigm Publishing Inc.

80 COMMANDS REVIEW…/9 How do you modify an editable attribute in a template instance? click Modify click Template Properties Copyright 2005, Paradigm Publishing Inc.

81 COMMANDS REVIEW…/10 How do you open a template attached to a document? click Modify point to Templates click Open Attached Template Copyright 2005, Paradigm Publishing Inc.

82 COMMANDS REVIEW…/11 How do you open the Assets panel Library items? click Window click Assets click the Library button Copyright 2005, Paradigm Publishing Inc.

83 COMMANDS REVIEW…/12 How do you open the Assets panel Templates category? click Window click Assets click the Templates button Copyright 2005, Paradigm Publishing Inc.

84 COMMANDS REVIEW…/13    How do you remove an editable region?
click Modify point to Templates click Remove Template Markup Copyright 2005, Paradigm Publishing Inc.

85 COMMANDS REVIEW…/14 How do you save a template as an HTML document? click File click Save As Copyright 2005, Paradigm Publishing Inc.

86 COMMANDS REVIEW…/15 How do you save an HTML document as a template? click File click Save as Template Copyright 2005, Paradigm Publishing Inc.

87 COMMANDS REVIEW…/16    How do you set template preferences?
click Edit click Preferences click Highlighting Copyright 2005, Paradigm Publishing Inc.

88 COMMANDS REVIEW…/17    How do you update a template? click Modify
point to Templates click Update Pages Copyright 2005, Paradigm Publishing Inc.

89 COMMANDS REVIEW…/18 How do you update all documents using a library item? click Modify point to Library click Update Pages Copyright 2005, Paradigm Publishing Inc.

90 COMMANDS REVIEW…/19    How do you update the current document?
click Modify point to Templates click Update Current Page Copyright 2005, Paradigm Publishing Inc.

91 COMMANDS REVIEW…/20 How do you update the current document library item? click Modify point to Library click Update Current Page Copyright 2005, Paradigm Publishing Inc.

92 COMMANDS SUMMARY Attach a template to an existing document
Modify, Templates, Apply Template to Page Create a library item Modify, Library, Add Object to Library Create a new template instance File, New, Templates tab Create an editable tag attribute Modify, Templates, Make Attribute Editable Detach a template from a document Modify, Templates, Detach from Template Insert a repeating region Insert, Template Objects, Repeating Region Insert a repeating table Insert, Template Objects, Repeating Table Copyright 2005, Paradigm Publishing Inc.

93 COMMANDS SUMMARY…/2 Insert an editable region
Insert, Template Objects, Editable Region Modify an editable attribute in a template instance Modify, Template Properties Open a template attached to a document Modify, Templates, Open Attached Template Open the Assets panel Library items Window, Assets, Library button Open the Assets panel Templates category Window, Assets, Templates Remove an editable region Modify, Templates, Remove Template Markup Save a template as an HTML document File, Save As Copyright 2005, Paradigm Publishing Inc.

94 COMMANDS SUMMARY…/3 Save an HTML document as a template
File, Save as Template Set template preferences Edit, Preferences, Highlighting category Update a template Modify, Templates, Update Pages Update all documents using a library item Modify, Library, Update Pages Update the current document Modify, Templates, Update Current Page Update the current document library item Modify, Library, Update Current Page Copyright 2005, Paradigm Publishing Inc.


Download ppt "Using Templates and Library Items"

Similar presentations


Ads by Google