Section 26th using Libraries

Source: Internet
Author: User
Tags contains modify window dreamweaver

The purpose and template of the library are similar, and they are all available for the same content to be used on different pages. But the library is small, using just one or a few page elements. Application template, the overall structure and content of the Web page has been determined, just change part of the content, and the application library, only to the page to add a part of the page elements.

Click on the menu bar window\library, or click on the Launcher panel to the left of the second icon, or directly using F6, pop-up library panel.

Library (library panel) libraries are made up of entries. You can create a new entry, or you can set an existing page element as an entry.
To create a new entry, click on the icon at the bottom right of the library panel. At this point, there is an extra item named Untitle on the panel, which can change its name.
Double-click the entry, or select this entry and click on the icon, which opens a new Dreamweaver window. At this point, you can edit an entry in this newly opened window.
Here, you can add a General page element as an entry for the library. However, CSS, timeline, and behavior are not available at this time because only the page elements that belong to the body part of the page file HTML code can be set as library entries. CSS generated by Dreamweaver code is located in the head of the page file HTML code, timeline the function of the JavaScript code is also in the page file HTML code in the head section. Behavior is special, its generated code has two parts, part of the page file HTML code in the Head section, the other part of the page file HTML code in the body part. Later, when you set an existing page element as an entry, you can set the behavior as an entry for the library.
Images, text can be set as entries.

Another way to set up an entry is to set an existing page element as an entry.
Select the page elements you want to set, click on the library panel on the bottom right of the library panel icon, you can also click on the menu bar Modify\library\add Object to Library, or use the shortcut key ctrl+shift+b.
When the setting is complete, a new item named Untitle is available on the panel, changing its name at this time.
If you select a page element that contains CSS and timeline information, the page element itself can be used as an entry when set as an entry, but CSS and timeline information cannot be used. If the page element you select contains behavior information, then the page element, along with the behavior information, can be used as an entry. The principle is that behavior's code in the body part of the page file is saved to the entry, and when the entry is used, Dreamweaver automatically generates the code in the head of the page file based on this part of the code. In this way, behavior can also be set as an entry.


Next we'll talk about how to apply the entry.
First move the cursor in the Dreamweaver main window to where you want to add the entry. Select the entry you want to add to the library panel, and then click the Insert button at the bottom left of the panel. Entries cannot be edited in the Dreamweaver main window, but you can modify the entries by editing the HTML source files. Next, we'll introduce the properties panel for the entry. Select an entry on the page and the properties panel will look like the one shown in the picture.

There are three buttons--open, Detach from original and recreat on the properties panel of the entry.
Click the Open button to open a new window dreamweaver. This entry can be edited in this window.
Clicking the detach from original button is the link between the current page and the item being used. Once disconnected, this inserted entry can be edited in the Dreamweaver main window, but the current page cannot be updated automatically with the entry.
Click the Recreat button to regenerate this entry. When the item file is deleted, renamed or changed, click the Recreat button to regenerate the entry file with the entry used on the current page.


When an entry is modified, it is convenient to update the page that uses the entry with Dreamweaver.
Click the Modify \library\update Current page of the menu bar to pop up the Update Page dialog box. In fact, this dialog box is the same as the Update Page dialog box in the previous section, "Using Templates."
Only, at this point, select the library Item after update.

This is the end of the full tutorial.

 



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.