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

Lesson 8. 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 library item file and creates a reference to that library item. When you insert a library item, the actual HTML is inserted, which means the content appears even if the library item is not available in the Library folder. Dreamweaver inserts comments in the code around the item to show the name of the library file and the reference to the original item. The comments and reference are not visible in the browser window. The reference to the external library item file is what makes it possible to update the content on an entire site all at once simply by changing the library item.

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

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

NOTE

If the Library panel is not visible, choose Window > Assets and click the Library icon in the Assets panel. The Assets panel is located in the Files panel group.

2.
Drag the copyright file icon from the Library panel to the bottom of the document window.

TIP

Alternatively, you can select the copyright library item and then click Insert at the bottom left corner of the panel to insert the item into the Library.

The text and rule are added to the document. The copyright library item is shown with a yellow background; the color will not be displayed in the browser. 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.

Use library item properties in the Property inspector to see the name of the source file and to perform maintenance functions for the library item that is selected in the document window. The Property inspector has several options:

  • Src: Displays the filename 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, 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 the item has been edited.

You can save and close the culture.html document.

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

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

4.
Hold down Option (Macintosh) or Control (Windows) and drag the copyright file icon 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. Since these elements are detached, they will not be updated if any changes are made to the original library item.

You can save and close the technology.html document. Save the lights.html 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