Section 25th using templates

Source: Internet
Author: User
Tags add modify window dreamweaver
Template

Templates can be understood as a model. Use this model to easily make a lot of pages, and then on the basis of each page to change, add individual content. In order to unify the style, many pages of a website have to use the same page elements and layout method, the appearance of the template is to avoid in duplicate in each page input or modify the same part.


To create a template, you can make a new version directly, or you can set an existing page page as a template. Click on the Dreamweaver main Window menu bar window\templates, or directly with the shortcut key ctrl+f12, that is, pop-up template panel.

Template panels in the Templates panel display all the template names in the local site.
Click on the icon in the lower right corner of the template, when the panel is more famous as a untitled, you can change the Untitle to another name.

Double-click on the template panel, that is, a Dreamweaver window, you can begin to edit this template.
Editing the template is basically the same as editing the page page, just to make the editable and locked areas, which will be mentioned later.
At the end of the edit, click the File\save as Template in the menu bar to save the template by clicking the pop-up dialog box. Choose which local site to save to on the Drop-down menu after site in the dialog box. Dreamweaver will save the template file in the Templates folder in the local site. If the local site does not yet have this folder, Dreamweaver will automatically generate this folder.


To edit a template, you set the editable and locked areas.
Editable area, that is, when the template is applied, the contents of the area can be changed, the lock area, that is, when the template is applied, the contents of the area can not be changed.
To mark an existing content as an editable area, select this and click Modify\templates\ Mark Selection as Editable in the menu bar ... to pop up a dialog box. After name, type the name you gave to the edit area.
To enter new content as an editable area, move the cursor to the position you want to enter, and then click on the menu bar modify\templates\new Editable Region ..., pop-up dialog box. After name, type the name you gave to the editable area.
You can set the page elements such as images, text, tables, layers, behavior, etc. into editable areas. Note that you can set the entire table and the contents of the table into an editable area, you can also set a TABLE element and its contents into an editable area, but you can not put several different elements and its contents to the same editable area. Layer and layer content is a separate page element, the layer is set as editable area, then the template application layer can be moved, the contents of the layer into the editable area, the template application layer content can be edited.
Areas outside the editable area are locked areas. To change the editable area to the lock area, click Modify\templates\unmark Editable Region ..., and then a dialog box pops up. The name of all editable regions in the template will be displayed on this dialog box, select the editable area that needs to be changed, and click the OK button.


To apply a template, you can create a new page that uses a template directly, or you can apply a template to an existing page.
To create a new page that uses a template directly, click the file\new from Template menu bar to pop up a selection template dialog box. On the dialog, select a local site from the Drop-down selection box after the site, select the template from behind the templates, and then click the Select button.
In an existing page to apply the template, you need to open the template panel, select the template to add on the Panel, click on the lower left of the Apply button.
In the applied page, the lock area is displayed in brightness and cannot be edited. The contents of the editable area can be edited. However, you can edit the lock area of the template using the method of editing the HTML source file at this time.


When you apply a template to a page, you can use the Automatic Updates feature.
Change the template first, and then let Dreamweaver automatically update the page that applied the template. Click on the Modify\templates\update Current page of the menu bar to update the active pages.
If you need to update all the pages at the same time, click on the menu bar modify \library\update pages ..., and then pop up a dialog box. You should select templates after update. Select entire site after look in to update the page for the entire site. Select, and then select a local site in the Drop-down box immediately following it. Select the use ... is to update all pages that have a specific template applied to it. Select, and then select a template in the Drop-down selection box immediately following it. Then click the Start button to start the update. If you select the box before show log, the update displays the completion report.
When you are done, click the Close button to turn off the dialog box.
To cut off a link between a template and a template, click on the menu bar modify\template\ Detach from Template ... Can.


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.