Making Shared Assets Available


SSIs are not the only type of common element on the Web designer's palette. Other assetssuch as images, Flash movies, and even blocks of codecan be inserted in various pages throughout a Web site. Contribute has the capability to make such shared assets available to allor just someof a site's content contributors.

Through a feature called shared assets, new in Contribute 3, any image, Flash movie, or Dreamweaver library item can be jointly identified. To qualify as a shared asset, a file must be present on the Web server. You can specify particular assets to be shared for individual roles defined in the Contribute administration profile, or enable them all to be shared across the board.

The advantage of using shared assets varies according to the media type. Both images and Flash movies can generally be inserted into a page from either the content contributor's local system or the site. Such wide-open access may lead to quality control issues: Given carte blanche, it's very easy to see how a contributor might post images that are unsuitable for the site, whether in size, design, or content. Content contributors can be limited to using only those images that have been approved and posted on the server.

Shared assets are also helpful in identifying the proper version of an image or Flash movie to use. Any given site can have multiple files called logo.jpg, but only one is intended to be used by content contributors. Another benefit with images and Flash movies is ease of use; if a file is not marked as a shared asset, the user may have to look through multiple folders to find the desired file.

Dreamweaver library items can be inserted only via the Shared Assets interface. A library item can be a simple text block, consistently styledsuch as a boilerplate disclaimer with a CSS classor something as complex as an entire navigation bar complete with rollover graphics. A key benefit of using library items in both Dreamweaver and Contribute is the easy addition of client-side behaviors. After you have applied a behavior to a library item, all the necessary JavaScript code is automatically inserted when the library item is added to a page. For example, you could create a library item with a graphic that shows a hidden layer when clicked. Unlike Dreamweaver, however, Contribute doesn't allow direct editing of the behavior's parameters.

There is one primary difference between SSIs and library items in Contribute. Although SSIs always maintain a link between the SSI file and the page in which it is inserted, library items never do. To update a library item in Contribute, the user must delete the old version of the item and reinsert a modified one published to the site.

In the following steps, you'll see how to do the following:

  • Work with a library item

  • Make the item available on the site

  • Designate the item as a shared asset

  • Set the item's properties

  • Use the item in Contribute

Because you're not building the example library item from the ground up, first take a closer look at it to better understand its structure.

1.

In the Dreamweaver Files panel, expand the hr folder and open the policy.htm file. Scroll down to the bottom of the page and place your cursor in the bottom-left section. From the Assets panel, select the Library category, choose the HelpDesk library item, and click Insert.

Library items are discrete sections of code that can be dropped into a page. This particular example consists of a graphic and a bit of text, both wrapped in a link. A generic javascript:; link is assigned to act as a trigger for an Open Browser Window behavior. The behavior opens the help.htm file found in the media folder, by using a small window.

2.

With the library item in place, press F12 to preview the page in your primary browser. When the page displays, scroll down to the bottom of the file and click the Help Desk link. The help.htm file should appear in a small window. Click the Close Window link and return to Dreamweaver.

You could, if desired, make changes to the library item by double-clicking it in the Assets panel. The library item opens for editing in a separate file; changes to any attached behavior must be handled in Code view. When the modified library item is saved, Dreamweaver prompts you to update any instances inserted into pages in your site.

Tip

If you need to adjust the behavior attached to a library item and don't want to use Code view, there's another way. Detach the library item from the original, double-click the behavior in the Behaviors panel, and make your changes. When you're done, resave the object as a new library item. If your library item is already inserted on pages, delete the original item and save the revised item with the original name.

3.

From the Files panel, select the HelpDesk.lbi file in the Library folder and choose Check In to move it to the remote Contribute-ready site. When Dreamweaver asks if you want to transfer the dependent files, click Yes to move the associated graphic file. Select help.htm in the media folder and click Check In to make sure that the external file is available on the site.

Although Dreamweaver easily handles dependent files through the Check In process, files referenced in JavaScript are not incorporated and must be transferred separately. With the appropriate files copied to the remote server, you're now ready to declare the library item as a shared asset.

4.

Double-click the site name in the Files panel to open the Site Definition dialog box. Switch to the Contribute category and select Administer Site in Dreamweaver. When the Administer Website dialog box is displayed, make sure that the Administrator Site in Contribute role is selected and choose Edit Role Settings.

You can define shared assets separately for any role; here, you want to make sure that you are defining them for your own role: Administrator.

5.

In the Role Definition dialog box, select the Shared Assets category. Choose Add (+) > Library Item and select HelpDesk.lbi from the Choose Library Item dialog box. Click OK to confirm your choice.

If all of your library items should be regarded as shared assets, you can choose the "Select All Files in This Folder" button.

6.

After you select your library item, the Shared Asset Properties dialog box is displayed. Enter Help Desk as the name of the asset and select the "Lock item on page" option. Click OK once to close this dialog box and again to close the Role Definition dialog box. Choose Close to dismiss the Administer Site dialog box, and click OK to complete the process and close the Site Definition dialog box.

In some situations, you'll want to leave the shared asset unlocked so that it can be modified. With this example, however, it's better to retain a consistent look and feel whenever the library item is used. In these next few steps, you'll see how the Contribute user adds a shared asset to the page.

7.

In Contribute, click Choose to display the Choose File on Website dialog box. Navigate to the hr folder in the site root and select training_schedule.htm. Click OK to confirm your choice.

After you become familiar with a site's structure, it's also possible to enter the direct path to a file in the Address field and click Go to browse to a page.

8.

Choose Edit and (as you did in Dreamweaver) move to the bottom of the page. Place your cursor in the lower-left section and select Insert > Shared Asset. When the Insert Shared Asset dialog box opens, choose Help Desk and click OK.

If your site has many shared assets of a variety of types, use the select list at the top of the Insert Shared Assets dialog box to view only library items, graphics, or Flash movies.

9.

To test the page, select Publish; click OK to clear the congratulations message if it appears. When the page is visible in the browser, scroll down to the bottom and click either the Help Desk graphic or text.

If a library item identified as a shared asset is ever modified in Dreamweaver, the new version of the item must be checked in again, and the Contribute user must delete the original copy of the shared asset and insert a new copy. Unlike SSIs, library items don't update automatically in Contribute.



Design and Deploy Websites with Macromedia Dreamweaver MX 2004 and Contribute 3(c) Training from the Source
Design and Deploy Websites with Macromedia Dreamweaver MX 2004 and Contribute 3: Training from the Source
ISBN: 032128884X
EAN: 2147483647
Year: 2006
Pages: 130
Authors: Joseph Lowery

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net