Dreamweaver MX 2004 Wrking with Libraries
Table f Cntents Using the Assets panel... 3 Viewing Assets in the Assets panel...4 Wrking with Library Items... 6 Creating a library item...6 Inserting a library item in a dcument...7 Editing a library item...8 Making library items editable in a dcument...11 Editing the prperties fr a library item...11 Setting Library item prperties...12 Excerpted frm Dreamweaver MX 2004 Help Page 2 f 12 Cpyright 1997-2003 Macrmedia, Inc.
Using the Assets panel Assets include a variety f elements that yu stre in a site, such as an image r mvie file. The Assets panel prvides tw ways t view assets: The Site list shws all f the assets in yur site. The Favrites list shws nly the assets yu ve explicitly chsen. In bth lists, assets are divided int the fllwing categries, which appear n the left side f the Assets panel: Images are image files in GIF, JPEG, r PNG frmatsclrs are the clrs that are used in dcuments and style sheets in yur site, including text clrs, backgrund clrs, and link clrs. URLs are the external links in yur current site dcuments. This categry includes the fllwing types f links: FTP, gpher, HTTP, HTTPS, JavaScript, e-mail (mailt), and lcal file (file://) Flash files are files in any versin f Macrmedia Flash frmat. The Assets panel displays nly SWF files (cmpressed Flash files), but nt FLA (Flash surce) files. Shckwave mvies are files in any versin f Macrmedia Shckwave frmat. Mvies are files in QuickTime r MPEG frmat. Scripts are JavaScript r VBScript files. Templates prvide an easy way t reuse the same page layut n multiple pages and t mdify the layut n all pages attached t a template when a template is mdified. Library items are elements that yu use in multiple pages; when yu mdify a library item, all pages that cntain that item are updated. Excerpted frm Dreamweaver MX 2004 Help Page 3 f 12 Cpyright 1997-2003 Macrmedia, Inc.
Viewing Assets in the Assets panel Yu can view and manage assets in the current site using the Assets panel. The Assets panel displays assets fr the site assciated with the active dcument in the Dcument windw. Nte: Yu must define a lcal site befre yu can view assets in the Assets panel. Fr mre infrmatin abut setting up a site. The Assets panel prvides tw views: The Site list shws all f the assets in yur site, including clrs and URLs that are used in any dcument in yur site. The Favrites list shws nly the assets yu ve explicitly chsen. In bth lists, assets are divided int categries (alng the left side f the Assets panel). The Site list and the Favrites list are bth available fr all categries f assets except templates and library items. Nte: Mst f the Assets panel peratins wrk the same in the Site list and in the Favrites list. There are a few tasks, hwever, that yu can perfrm nly in the Favrites list. By default, assets in a given categry are listed in alphabetical rder by name. Yu can instead list the assets by any f several ther criteria r change the size f the clumns. Yu can als preview assets in a categry, and change the size f the preview area. T pen the Assets panel: Select Windw > Assets. The Assets panel appears. By default, the Images categry is selected. T view the Site list: In the Assets panel (Windw > Assets), select the Site ptin at the tp f the panel. Excerpted frm Dreamweaver MX 2004 Help Page 4 f 12 Cpyright 1997-2003 Macrmedia, Inc.
Nte: In the Templates and Library categries (n the left side f the Assets panel), the Site and Favrites chices are unavailable. T view the Favrites list: In the Assets panel (Windw > Assets), select the Favrites ptin at the tp f the panel. The Favrites list is empty until yu explicitly add assets t it. Nte: In the Templates and Library categries (n the left side f the Assets panel), the Site and Favrites chices are unavailable. T display assets in a particular categry: Click the apprpriate icn n the left side f the Assets panel (Windw > Assets). T list assets in a different rder: Click ne f the clumn headings. Fr example, t srt the list f images by type (s that all the GIF images are tgether, all the JPEG images are tgether, and s n), click the Type clumn heading. T change the width f a clumn: Drag the line that separates tw clumn headings. T preview an asset: Select the asset in the Assets panel. The preview area at the tp f the panel shws a visual preview f the asset. Fr example, when yu select a mvie asset, the preview area shws an icn. T view the mvie, click the Play buttn (the green triangle) in the upper right crner f the preview area. T change the size f the preview area: Drag the splitter bar (between the preview area and the list f assets) up r dwn. Excerpted frm Dreamweaver MX 2004 Help Page 5 f 12 Cpyright 1997-2003 Macrmedia, Inc.
Wrking with Library Items Libraries are a way t stre page elements such as images, text, and ther bjects that yu want t reuse r update frequently thrughut yur website. A library is a special Dreamweaver file that cntains a cllectin f individual assets r cpies f assets yu have created fr placement in yur web pages. These assets in a library are called library items. Yu can update all the pages that use a library item whenever yu change the item s cntents. Yu can stre all srts f page elements, such as images, tables, sunds, and Flash files in a library. Creating a library item Yu can create a library item frm any element in the bdy sectin f a dcument, including text, tables, and images. Fr linked items such as images, the library stres nly a reference t the item. The riginal file must remain at the specified lcatin fr the library item t wrk crrectly. T create a library item based n a selectin: 1. In the Dcument windw, select a prtin f a dcument t save as a library item. 2. Click the New Library Item buttn at the bttm f the Library categry f the Assets panel (Windw > Assets). 3. Type a name fr the new library item, then press Enter (Windws) r Return (Macintsh). Dreamweaver saves each library item as a separate file (with the file extensin.lbi) in the Library flder f the site s lcal rt flder. T create an empty library item: 1. Make sure nthing is selected in the Dcument windw. If smething is selected, it will be placed in the new library item. 2. In the Assets panel (Windw > Assets), select the Library categry n the left side f the panel. Excerpted frm Dreamweaver MX 2004 Help Page 6 f 12 Cpyright 1997-2003 Macrmedia, Inc.
3. Click the New Library Item buttn at the bttm f the Assets panel. A new, untitled library item is added t the list in the panel. 4. While the item is still selected, enter a name fr it, then press Enter (Windws) r Return (Macintsh). Inserting a library item in a dcument When yu add a library item t a page, the actual cntent is inserted in the dcument alng with a reference t the library item. T insert a library item in a dcument: 1. Place the insertin pint in the Dcument windw. 2. In the Assets panel (Windw > Assets), select the Library categry n the left side f the panel. 3. D ne f the fllwing: Drag a library item frm the Assets panel t the Dcument windw. Excerpted frm Dreamweaver MX 2004 Help Page 7 f 12 Cpyright 1997-2003 Macrmedia, Inc.
Tip: T insert the cntents f a library item withut including a reference t the item in the dcument, press Cntrl (Windws) r Optin (Macintsh) while dragging an item ut f the Assets panel. If yu insert an item this way, yu can edit the item in the dcument, but the dcument wn t update when yu update pages that use that library item. Select a library item, then click the Insert buttn at the bttm f the panel. Editing a library item When yu edit a library item, yu can update all dcuments that use that item. If yu chse nt t update, the dcuments remain assciated with the library item; yu can update them later. Other kinds f changes t library items include renaming items t break their cnnectin with dcuments r templates, deleting items frm the site s library, and recreating a missing library item. Nte: The CSS Styles panel is unavailable when yu are editing a library item, since library items can cntain nly bdy elements and CSS style sheet cde inserts in the head sectin f a dcument. The Page Prperties dialg bx is als unavailable, because a library item can t include a bdy tag r its attributes. T edit a library item: 1. In the Assets panel (Windw > Assets), select the Library categry n the left side f the panel. 2. Select a library item. A preview f the library item appears at the tp f the Assets panel. (Yu can t edit anything in the preview.) 3. D ne f the fllwing: Click the Edit buttn at the bttm f the panel. Duble-click the library item. Dreamweaver pens a new windw fr editing the library item. This windw is much like a Dcument windw, but its Design view has a gray backgrund t indicate that yu re editing a library item instead f a dcument. Excerpted frm Dreamweaver MX 2004 Help Page 8 f 12 Cpyright 1997-2003 Macrmedia, Inc.
4. Edit the library item, then save yur changes. 5. In the dialg bx that appears, select whether t update the dcuments n the lcal site that uses the edited library item: Select Update t update all dcuments in the lcal site with the edited library item. Select Dn t Update t avid changing any dcuments until yu use Mdify > Library > Update Current Page r Update Pages. T update the current dcument t use the current versin f all library items: Select Mdify > Library > Update Current Page. T update the entire site r all dcuments that use a particular library item: 1. Select Mdify > Library > Update Pages. The Update Pages dialg bx appears. 2. In the Lk In pp-up menu, d ne f the fllwing: Select Entire Site, then select the site name frm the adjacent pp-up menu. This updates all pages in the selected site t use the current versin f all library items. Select Files That Use, then select a library item name frm the adjacent pp-up menu. This updates all pages in the current site that use the selected library item. 3. Make sure Library Items is selected in the Update ptin. Tip: T update templates at the same time, make sure Templates is als selected. Click Start. Dreamweaver updates the files as indicated. If yu selected the Shw Lg ptin, Dreamweaver prvides infrmatin abut the files it attempts t update, including infrmatin n whether they were updated successfully. Excerpted frm Dreamweaver MX 2004 Help Page 9 f 12 Cpyright 1997-2003 Macrmedia, Inc.
T rename a library item: 1. In the Assets panel (Windw > Assets), select the Library categry n the left side f the panel. 2. Select the library item yu want t rename, pause, then click again. 3. When the name becmes editable, enter a new name. Nte: This methd f renaming wrks the same way that renaming a file in Windws Explrer (Windws) r the Finder (Macintsh) des. As with Windws Explrer and the Finder, make sure t pause briefly between clicks. D nt duble-click the name; that pens the library item fr editing. 4. Click elsewhere, r press Enter (Windws) r Return (Macintsh). 5. Dreamweaver asks if yu want t update dcuments that use the item: T update all dcuments in the site that use the item, click Update. T refrain frm updating any dcuments that use the item, click Dn t Update. T delete a library item frm a library: 1. In the Assets panel (Windw > Assets), select the Library categry n the left side f the panel. 2. Select the library item yu want t delete. 3. D ne f the fllwing: Click the Delete buttn at the bttm f the panel, then cnfirm that yu want t delete the item. Press the Delete key, then cnfirm that yu want t delete the item. Cautin: Be careful; if yu delete a library item, yu can t use Und t retrieve it. Yu may be able t recreate it, hwever, as described in the next prcedure. Dreamweaver remves the library item frm the library, but desn t change the cntents f any dcuments that use the item. Excerpted frm Dreamweaver MX 2004 Help Page 10 f 12 Cpyright 1997-2003 Macrmedia, Inc.
T recreate a missing r deleted library item: 1. Select an instance f the item in ne f yur dcuments. 2. Click the Recreate buttn in the Prperty inspectr (Windw > Prperties). Making library items editable in a dcument If yu ve added a library item t yur dcument and yu want t edit the item specifically fr that page, yu must break the link between the item in the dcument and the library. Once yu ve made an instance f a library item editable, that instance cannt be updated when the library item changes. T make a library item editable: 1. Select a library item in the current dcument. 2. Click Detach frm Original in the Prperty inspectr (Windw > Prperties). The selected instance f the library item lses its highlighting (if yu had highlighting visible), and can n lnger be updated when the riginal library item changes. Editing the prperties fr a library item Yu can use the Prperty inspectr fr a library item t pen a library item fr editing, detach a selected library item frm its surce file, r verwrite an item with the currently selected library item. T edit the prperties fr a library item: 1. Select a library item in a dcument. 2. Click ne f the buttns in the Prperty inspectr (Windw > Prperties), depending n what yu want t d. Excerpted frm Dreamweaver MX 2004 Help Page 11 f 12 Cpyright 1997-2003 Macrmedia, Inc.
Setting Library item prperties Use library item prperties t specify the surce file f an item, t make it editable, r t recreate the riginal library item after editing an instance f it in a dcument. T set library item prperties: Select any f the fllwing ptins: Src displays the filename and lcatin f the surce file fr the library item. Yu can t edit this infrmatin. Open pens the library item s surce file fr editing. This is equivalent t selecting the item in the Assets panel and clicking the Edit buttn. Detach frm Original breaks the link between the selected library item and its surce file. When an item is detached it can be edited in the dcument, but it s n lnger a library item and can t be updated when yu change the riginal library item. Recreate verwrites the riginal library item with the current selectin. Use this ptin t recreate library items if the riginal library item is missing r has been accidentally deleted. Excerpted frm Dreamweaver MX 2004 Help Page 12 f 12 Cpyright 1997-2003 Macrmedia, Inc.