Dreamweaver defines templates to create web pages in batches

Source: Internet
Author: User
Tags dreamweaver
If you are not using the cms system, manual work is very heavy.

Let me tell you a secret. In fact, you only need to use the template tool to "wholesale" webpages. This feature is available in common webpage creation tools such as DreamWeaver. Using templates can greatly reduce repetitive work.

1. Create a template

1. Create a template page

The simplest way is to Save a webpage as a Template File. By executing the command: File → Save as Template, DreamWeaver creates a Template folder named Templates in the root directory of the website to Save the Template.

Of course, you can also create a New Template: Window → Templates, the Templates panel appears, click the New Template button in the lower right corner, enter the file name, and an empty Template is created; click the Open Template button to Open the Template. The Template is automatically saved in the Templates folder.

The newly created and opened template pages are similar to the common web pages. You can also add tables, layers, images, animations, scripts, and set page attributes.

For example, a template is used as an example. On this page, we want the website logo image on the left and the navigation chart at the bottom to appear on each page. The logo chart is composed of two overlapping images. The text "last update", "online reading", and "package download" on the navigation chart is divided into several hot zones to link to different files, they remain unchanged on every page. The page descriptions under the upper right homepage area and the pop-up menu button in the lower left corner are different. To keep the page clean, we use tables to deploy these elements.

To be accurate, it is just a "quasi-template" without editable areas. Next, set the editable area.

2. Set editable regions

Set the editable area of the template. Generally, there are two methods.

Create an Editable area: Select the command Modify → Template → New Editable Region. Click in a blank area and execute this command to change the area to an editable area.

Mark an area as an Editable area: Select command: Modify → Template → Mark Selectin as Editable Region. If you already have some text in a certain area and want to retain some of the text in a new hypertext File, select the area and then run the Mark command.

Uneditable status: Select the command Modify → Template → Unmark Editable Region. After you execute this command, a dialog box is displayed, with the list of existing editable regions. Select the name of the region to be canceled and click OK.

For example, click in a blank area and run the Modify → Template → New Editable Region Command. In the displayed dialog box, enter the name "Main" and select the text on the lower left corner of the page, run the Modify → Template → Mark Selectin as Editable Region command and enter the name exp. You can see that the editable area is light blue, and the template is created after saving.
II. Create web pages in batches using templates

1. Create a page based on the template


Command: File → New From Template. In the pop-up dialog box, select a template from the template list. The new page appears with a pale yellow background except the editable area, which cannot be modified. In the blank Main editing area, you can directly insert tables, text, images, and other operations. The Exp editing area retains the original text and can be modified or re-edited.

2. Apply a template to an existing page

Command: Modify → Template → Apply Template to Page. After you select a template, a dialog box is displayed, asking you to select the Editable Region (Choose Editable Region for Orphaned Content) for saving the existing isolated Content ). If you do not want to retain it, you can select "(none )".

For example, first create a common Page, enter "CIW Computer Studio", execute the Modify → Template → Apply Template to Page command, select the Template test, and select Main as the storage area of the existing content, after confirmation, the page is automatically displayed as a template page, and the word "CIW computer studio" appears in the main editing window.

3. Update the template to fully update the site

After some pages are created based on a template, when the template is modified and saved, a dialog box will pop up automatically listing all pages using the template and asking whether to update the template.

Another method is to execute the Modify → Template → Update Pages command. Select a template for a site or site from the Update Pages dialog box (multiple templates can be used in the same site), and click the Start button on the right, the software automatically searches for and updates the webpage associated with the template. Very convenient!

For example, in the left-side figure of the Test template, the image "reading a hundred thousand sites" is superimposed on another image with one layer, and you do not want it now, you also want to delete the image from all pages. You can open the template test. dwt, delete the layer, save the template, and click the "Update" button on the right.

Note: Before creating and using a template, you must define a site. Run Site → Define Sites to specify the Site name and Local Root directory ).

</

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.