• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Lesson 7. Using Libraries > Placing a Library Item on a Page

Placing a Library Item on a Page

Placing a library item in a document inserts the contents of the file and creates a reference to the external file. When you insert a library item, the actual HTML is inserted, which means the content appears even if the file is viewed locally. Dreamweaver inserts comments around the item to show the name of the library file and reference the original item. The reference to the external library item file makes it possible to update the content on an entire site all at once by simply changing the library item.

1.
Open cycling_intro.htm and place the insertion point on a blank line at the bottom of the document.

You will place the library item you created in the previous exercise into this document in the following steps.

NOTE

If the Library panel is not visible, choose Window > Library. You can also click Show Assets on the mini-launcher located at the bottom-right corner of the document window bar, and then click Library.

2.
Drag the footer file icon from the Library panel to the document window. Alternatively, you can select the footer library item, and then click Insert at the bottom left of the panel.

The text and rule are added to the document; footer is shown with a yellow background. While library items are highlighted with yellow by default, the color can be changed or turned off completely in the Preferences dialog box. This item cannot be modified directly on the page. You will modify library items in the next exercise.

With the library items selected in the document window, you can use the property inspector to view the source path and perform maintenance functions on the library items.

The property inspector has several options to choose from. Src displays the file name and location of the source file for the library item. You can open the library item for editing with the Open option. You must save the file to keep the changes you make.

Detach from Original breaks the link between the selected library item and its source file. The content of the library item becomes editable within the document, but it can no longer be updated by the library update functions.

Recreate overwrites the original library item with the current selection. Use this option to create library items again if the library file isn't present, the item's name has been changed, or if the item has been edited.

You can save and close the biking.htm document.

3.
Open road.htm and place the insertion point on a blank line at the bottom of the document.

You will place a copy of the library item with copyright information on this page so it is editable in the document.

4.
Hold down Control (Windows) or Option (Macintosh) and drag footer from the Library panel to the document.

The library content is copied into the document but is not linked to the library, so there is no yellow highlighting. The elements can be modified directly on the page since they are not connected to a library item.

You can save and close the road.htm document. Save the cycling_intro.htm document, but leave it open for the next exercise.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint