The trouble with building a website is updating, especially large-scale updates, which require a lot of work. I really don’t know how those “webmasters” who are constantly creative and hard-working are busy doing “major changes” to their websites every once in a while.
Let me tell you this secret, many of them are on the "wholesale" web page, and your machine also has such a "wholesale station"! This good thing is - template. Common web page creation tools: FrontPage and DreamWeaver have this function. For example, when using DreamWeaver 3.0 to create a website, using templates can reduce a lot of repetitive work.
1. Create a template
1.
The easiest way to create a template page is to save a web page as a template file. By executing the command: File → Save as Template, DreamWeaver will create a template folder - Templates in the root directory of the website to save the template. template.
Of course, you can also create a new template: Window→Templates, the Templates panel will appear, click the New Template button in the lower right corner, enter the file name, and an empty template will be created; then click the Open Template button to open the template, and save it. Automatically stored in the website template folder Templates.
The newly created and opened template page is no different from an ordinary web page. You can also add tables, layers, pictures, animations, scripts, and set page properties.
Example: Here is an example of making a template. In this page, we want the website logo image on the left and the navigation image at the bottom to appear on every page. The logo picture is made up of two superimposed pictures. The text "Latest Update", "Online Reading", "Package Download", etc. on the navigation map are divided into several hot areas and linked to different files respectively. They are on each page. Nothing changes. The main page area in the upper right corner and the page description below the pop-up menu button in the lower left corner are different. To keep the page tidy, we use tables to lay out these elements.
To be precise, it is just a "quasi-template" without editable areas. The editable areas will be set below.
2. Set the editable area.
Generally speaking, there are two methods to set the editable area of the template.
Create a new editable region: Select the command: Modify→Template→New Editable Region. Click in a blank area and execute this command to make the area editable.
Mark a certain region as editable region: Select command: Modify→Template→Mark Selectin as Editable Region. If there is already some text in a certain area and you want to retain part of its content in a new hypertext file in the future, just select the area and then execute the mark command.
Cancel the editable state: Select the command: Modify→Template→Unmark Editable Region. After executing this command, a dialog box will pop up, which contains a list of currently existing editable areas. Select the name of the area to be canceled and confirm.
Example: Click randomly in a large blank area, execute the Modify→Template→New Editable Region command, enter the name in the pop-up dialog box: Main; select the text under the description of this page in the lower left corner, execute Modify→Template→Mark Selectin as Editable Region command, enter name: exp. You can see that the editable area is displayed in light blue, and the template creation is completed after saving.
2. Use templates
1. Create a new page based on the template
command: File→New From Template. A dialog box will pop up, select a template from the template list, and the new page that appears will have a light yellow background except for the editable area, which cannot be modified. The blank Main editing area can be used to directly insert tables, text, pictures, etc. The Exp editing area retains the original text, which can be modified or re-edited.
2. Apply the template
command to a page that already has content: Modify→Template→Apply Template to Page. After selecting the template, a dialog box will pop up, allowing you to choose which editable region to save the existing orphan content (Choose Editable Region for Orphaned Content). If you don't want to keep it, you can select "(none)".
For example: We first create a new ordinary page, enter: "CIW Computer Studio", execute the Modify→Template→Apply Template to Page command, select template test, and select Main for the existing content storage area. After confirmation, you can see that the page automatically changes to The form of a template page has been changed, and the words "CIW Computer Studio" appear in the main editing window.
3. Update the template to fully update the site.
After creating some pages based on a certain template, when you modify the template and save it, a dialog box will automatically pop up listing all the pages that use the template and asking whether you want to update it.
Another method is to execute the Modify→Template→Update Pages command. Select a site or a certain template of the site from the Update Pages dialog box (multiple templates can be used in the same site), click the Start button on the right, and the software will automatically search for the web pages associated with the template and update them. Very convenient!
For example: The "Reading to Break 10,000 Stations" picture in the graphic on the left side of the Test template is superimposed on another picture with a layer. I don't want it now, and I also want to use this picture on all pages. delete. You can open the template test.dwt, delete the layer, save the template, and click the "Update" button on the right.
Note: You need to define a site before creating and using a template. The method is to execute the command: Site→Define Sites; specify the site name and local root directory (Local Root). The template uses a relative path. If the local location of the website is not specified, the software cannot accurately find and save the template file; and when applying the template to create and update a page, the hyperlinks in the page cannot change depending on the location where the page file is saved. Change accordingly.