Reusing Content with Templates and Libraries > Creating, managing, and editing library items > Creating a library item |
You can create a library item from any element in the body
section of a document, including text, tables, forms, Java applets, plug-ins, ActiveX elements, navigation bars, and images.
For linked items such as images, the library stores only a reference to the item. The original file must remain at the specified location for the library item to work correctly. It can still be useful to store an image in a library item, though; for example, you could store a complete img
tag in a library item, which would allow you to easily change the image's alt
text, or even its src
attribute, throughout the site. (Don't use this technique to change an image's width
and height
attributes, though, unless you also use an image editor to change the actual size of the image.)
Library items can also contain behaviors, but there are special requirements for editing the behaviors in library items; see Editing a behavior in a library item. Library items cannot contain timelines or style sheets, because the code for those elements is part of the head
section.
Note: In general, be cautious about mixing library items and templates on the same page; the results may sometimes be confusing.
To create a library item:
1 | Select a portion of a document to save as a library item. |
2 | Do one of the following: |
Choose Window > Library and drag the selection into the Library category of the Assets panel. | |
Click the New Library Item button at the bottom of the Assets panel (in the Library category). | |
Choose Modify > Library > Add Object to Library. | |
3 | Enter a name for the new library item. |
Each library item is saved as a separate file (with the file extension .lbi) in the Library folder of the site's local root folder. | |