email kara reuter email patrick lavergne

Web Site Design 2 : Web Authoring Tools CLASS: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12

CLASS 12


SITE MANAGEMENT WITH DREAMWEAVER

Dreamweaver offers two useful tools to make managing Web sites easy: templates and library items.

Templates
EX LIBRIS CANDY REVIEW
Site Management

Check out the completed Candy Review site, with its Flash intro.

All of the pages in the Candy Review Web site can be built from two Dreamweaver templates. (In fact, the only page that is built from the "about.dwt" is the "About Us" page — all the other pages are built from "basic.dwt".)

The navigation elements that appear on every single page, such as the link and locator graphics and the text menu, can be turned into separate Dreamweaver library items.

Use templates to create documents for your site that have a common structure and appearance. Templates are useful if you want to make sure that all of the pages in a site share certain characteristics, regardless of whether you are creating a new site or updating an existing site. Rather than setting the correct properties for every new page, or making changes to every single page, use a template to make changes to several pages at once.

When you create a template, you can indicate which elements of a page should remain constant (noneditable) and which elements can be changed. For example, if you are publishing an online magazine, the masthead probably won't change, but the title and content of the feature story will change in every issue. To indicate the style and location of the feature story, you can use placeholder text and define it as an editable region. To add a new feature article, the writer just selects the placeholder text and types the article over it.

You can modify a template even after you have used it to create documents. When you update documents that use the template, the noneditable sections of those documents will be updated to match the changes to the template.

Library items
Use library items for content that appears on many pages in your site and for content that must be updated frequently.

Placing a library item in a document inserts a copy of the HTML into the file and creates a reference to the original, external item. The reference to the external library item makes it possible to update the content on an entire site all at once by changing the library item and then using the update commands in the Modify > Library menu.

— Excerpted from Macromedia Dreamweaver Help Pages


TEMPLATES

Creating templates
You can create a template from an existing HTML document and then modify it to suit your needs, or you can create a template from scratch, starting with a blank HTML document.

Templates are automatically stored in the Templates folder in the local root folder for the site. When you create a new template, the Templates folder is created if it does not already exist.

To save an existing document as a template:

  1. Choose File > Open and select an existing document.
  2. Choose File > Save as Template.
  3. In the dialog box that appears, select a site and enter a name for the template in the Save As box.
  4. Click Save.

To create a new, blank template:

  1. Choose Window > Templates.
  2. In the Template palette, click New.
    A new, untitled template is added to the list of templates in the palette.
  3. While the template is still selected, enter a name for the template.

To edit a template, do one of the following:

  1. Choose Window > Templates.
  2. In the Template palette, double-click the name of the template.

Defining a template's editable regions
A template has two types of regions: editable and locked (noneditable). Editable regions are the sections of a template that have changing content, such as an article in a newsletter. Locked regions are the sections of a template that have static, unchanging content, such as a corporate logo or standard site navigation elements.

By default, templates are locked. You can add content to the template, but when you save the template, all content is marked noneditable. If you create a document from such a template, Dreamweaver warns you that the document will not contain any editable regions. To make a template useful, you must create editable regions, mark existing content as editable, or add new content and mark it as editable.

While you are editing the template itself, you can make changes to both the editable and locked regions. When the template is applied to a document, however, you can make changes only to the editable regions of the document; the locked regions of the document can't be modified.

To define existing content an editable region:

  1. Select the text or content you want to make editable.
  2. Choose Modify > Templates > Mark Selection as Editable.
  3. In the New Editable Region dialog box, enter a name for the region.

    The text or content is highlighted in the template. You can mark an entire table or an individual table cell as editable. However, you can't mark several cells editable at once. Layers and layer content are separate elements; both can be marked as editable. Marking a layer editable lets you change the position of the layer; marking layer content editable lets you change the content of a layer.

To define a new editable region:

  1. Place the cursor at the location where you want to insert an editable region.
  2. Choose Modify > Templates > New Editable Region.
  3. In the New Editable Region dialog box, enter a name for the region.

    The region name, surrounded by curly braces as in {region name}, is inserted into the template as a highlighted placeholder. When the template is applied to a document, you can substitute the placeholder with text, images, or other content.

Creating documents based on templates
You can use a template as a starting point for a new document or apply it to an existing document.

To create a new document based on a template, do one of the following:

  • Choose File > New From Template. In the dialog box that appears, choose a template and click Select.
  • Create a new document and then apply a template to it by dragging a template from the Template palette.

To apply a template to an existing document, do one of the following:

  • Choose Modify > Templates > Apply Template to Page. Choose a template from the list and click Select.
  • Drag the template from the Template palette to the Document window.
  • Select the template in the Template palette and click Apply to Page.
    When you apply a template to an existing document, the content in the template is added to the document. If the document already has a template applied to it, Dreamweaver attempts to match editable regions that have the same name in both templates and to insert the content from the editable regions into the editable regions in the new template. If there are nonmatching editable regions, or if an editable region in the previous template doesn't have a corresponding region in the new template, a dialog box appears prompting you to delete the extraneous regions or transfer them to the new template. If there are more editable regions in the new template, they will appear in the documents as placeholder content.

Modifying templates and updating the site
When you make a change to a template that you are using in the current site, Dreamweaver prompts you to update the pages that use the template. You can also use the update commands to manually update the current page or the entire site. Applying the update commands is the same as reapplying the template.

To open the template used to create the current document:

  • Choose Modify > Templates > Open TemplateName.dwt.

To update the current document to the most current version of a template:

  • Choose Modify > Templates > Update Current Page.

To update the entire site or all documents that use a particular template:

  1. Choose Modify > Templates > Update Pages.
    The Update Pages dialog box appears.
  2. From the Look in option, do one of the following:
    • Select Entire Site, and then select the site name. This updates all pages in the selected site to their corresponding templates.
    • Select Files That Use, and then select the template name. This updates all pages in the current site that use the selected template.

      Note: If you renamed a template, you must first reapply the template to the documents that reference it before updating the entire site.

  3. From the Update option, make sure Templates is checked.
  4. Click Start.

— Excerpted from Macromedia Dreamweaver Help Pages


LIBRARY ITEMS

Creating a library item
You can create a library item from any selected portion of a document body. When you create a library item from a selected portion of document, Dreamweaver converts the selected area into a library item.

Library items can include any BODY element, including text, tables, forms, images, Java applets, plugins, and ActiveX elements. Dreamweaver stores only a reference to linked items such as images. The original file must remain at the specified location for the library item to work correctly.

Library items can also contain behaviors, but there are special requirements for editing the behaviors in library items. Library items cannot contain timelines or style sheets, as the code for these elements is part of the HEAD.

To create a library item:

  1. Select a portion of a document to save as a library item.
  2. Do one of the following:
    • Choose Window > Library and drag the selection into the Library palette, or click the Create button on the Library palette. Press Control (Windows) or Command (Macintosh) to prevent the selection from being replaced by the new library item.
    • Choose Modify > Add Object to Library.
  3. Enter a name for the new library item.

Adding a library item to a page
When you add a library item to a page, the actual content is inserted in the document along with a reference to the original item. After the content has been inserted, the original item does not have to be present for the content to be displayed.

To add a library item:

  1. Place the cursor in the Document window.
  2. Choose Window > Library or click the Library button on the Launcher.
  3. Drag an item from the Library palette to the Document window, or select an item and click Add to Page.

    Press Control (Windows) or Command (Macintosh) while dragging an item out of the Library palette to insert the item's content without creating an instance of the item in the Library palette.

Making changes to a library item
Editing a library item changes the original item file. Dreamweaver lets you choose to update the edited item in all documents in the current site.

Note: The Style palette and the Timeline inspector are unavailable when you are editing a library item because library items can contain only BODY elements. Timeline and style sheet code is part of the HEAD. Similarly, the Behavior inspector is also unavailable because it inserts code into the HEAD as well as the BODY.

To edit a library item:

  1. Choose Window > Library or click Library on the Launcher.
  2. Select a library item and click Open, or double-click the item.
    Dreamweaver opens a new window for editing the library item
  3. Edit the library item and then save your changes.
  4. In the dialog box that appears, choose whether to update the documents on the local site with the edited library item. Choose Yes to update all documents in the local site with the edited library item. Choose No to not change any documents until you use Modify > Library > Update Current Page or Update Pages.

Updating library items replaces the content of an item in documents that include the item.

To update a library item:

  1. Choose Modify > Library > Update Pages.
  2. In the dialog box that appears, choose the files that you want to update.
    • Choose Entire Site to update all documents on the specified site.
    • Choose Files That Use to update all documents that use the specified library item.
  3. Click Start.

Note: You can also use the Update Pages dialog box to update pages that use a template.

Renaming a library item breaks the connection between items that were inserted with the old name and the renamed item.

To rename a library item:

  1. Select a library item in the Library palette.
  2. Click inside the item name.
  3. Enter a new name.

Deleting a library item removes the item from the library, but doesn't change the content of any documents.

To delete a library item:

  1. Choose Window > Library or click the Library button on the Launcher.
  2. Select an item in the Library palette.
  3. Click the Delete button or press the Delete key.

— Excerpted from Macromedia Dreamweaver Help Pages


FURTHER READING

Site Management


ASSIGNMENT

  • Identify any common structure and appearance among your Web pages and/or any content that appears on many pages in your site — experiment with templates and library items to manage your site efficiently.
  • Finish building the Web pages in your site.
  • Prepare any last-minute questions for review next week.


NEXT CLASS

Wrap-up/Review



school of the art insitute of chicago


division of continuing studies