Montana State University

Creating a Library Item

Library items are assets in Dreamweaver that speed up the creation and maintanence of the site. Data that is common to a number of sites, such as navagation bars or contact information, can be combined to form a library item. A single Library item can be added to a number of web pages within a given site. This means that when the information changes, a web developer can simply update the library item and subsequently have every page containing that library item update accordingly. In a single act, the web developer can save themselves from having to open up every last page individually to change the common data.

Library Items serve particularily well as navigation bars (navbar). Rather than having to adress each navbar individually updating the pages on the site relative to the open page, a library item in dreamweaver will automatically adjust the html to that it is pointing to the correct folder based on the initial code. This is better understood with an example.

A website consits of an index page, and a folder containing two random pages known as pageA.html and pageB.html.

Adding navigation to the index would require the following code:
<a href="index.html">Home</a>
<a href="folder/pageA.html">pageA</a>
<a href="folder/pageB.html">pageB</a>

Adding navigation to pageA on the other hand would require:
<a href="../index.html">Home</a>
<a href="pageA.html">pageA</a>
<a href="pageB.html">pageB</a>

These changes are time consuming. Using a library item created from the code in the index page, this would only have to be done once. The library item itself would then change its values based on each indidual page without designer input. For more information on navigation bars and library items see Creating a Navigation Bar Library Item

1. Create a New Site

After opening Dreamweaver CS3, select File from the top menu bar.

From here select New from the drop down list.

2. New Document

A new box will appear requesting the type of site required. Notice the list on the left side of the box. From the list select Blank Page.

3. HTML

From the list that appears select the top option: HTML. Click Create.



4. Add Text

Add a series of text lines and paragraphs.



5. Assets

In the bottom right of the screen select the Assets tab.



6. Select Library

Along the side of the tab is a number of small symbols depicting the various assets avaliable to the dreamweaver site. From the list select the Library icon from the bottom. It appears as an open book.



7. Select Text

Select the text created in Step 4.

8. New Library Item

In the blank space beside the Library icon, right click and select New Library Item.

9. Rename

Name the new file that appears. This is the new library item containing the text from Step 4.