adobe dreamweaver cs5 on demand part 72 docx

5 316 0
adobe dreamweaver cs5 on demand part 72 docx

Đang tải... (xem toàn văn)

Thông tin tài liệu

ptg 446 Chapter 18 Updating a Template Update a Template and All the Pages Based on the Template Open the template you want to update. Make changes to the template, using standard editing techniques. Click the File menu, and then click Save. The Update Templates Files dialog box opens, displaying all the page files based on the templates. Click Update to continue the update process, or click Don't Update to cancel the process. If you clicked Update, the Update Pages dialog box opens. ◆ Look In. Select Entire Site to update all the documents that use this template, or select Files That Use to update pages using a particular template. ◆ Templates and Library Items. Select to update templates, library items, or both. ◆ Show Log. Select to show a log upon completion. Click Start to update the files, if necessary, and then click Close. 6 5 4 3 2 1 If all you did with templates was to create new pages based on their design, that would be very powerful. However, there's more to a tem- plate than simply streamlining the creation of a simple Web page. The power of a template is that when you change one template, you have the option of changing all the associated pages. Now, that's what I'm talking about. When you edit and save a template, Dreamweaver asks you whether you want to automatically update the page files based on that template. If you decide not to automatically update the page files, you can manually change an individual page, all the pages that use a template, or the entire site using the Update commands. 4 5 6 From the Library of Wow! eBook ptg Chapter 18 Creating Templates 447 Update Pages Based on a Template Manually Open the template-based Web page you want to update. Click the Modify menu, point to Templates, and then click Update Pages. The Update Pages dialog box opens. Click the Look In list arrow, and then click Files That Use or Entire Site. Select the Templates and Library Items check boxes to update templates and library items in the template-based files. Select the Show Log check box to show a log upon completion. Click Start to update the files, and then click Close. 6 5 4 3 2 1 5 4 6 3 Did You Know? You can manually apply template changes to a page based on the tem- plate. Open the Web page based on the template, click the Modify menu, point to Templates, and then click Update Current Page. You can find an editable region and select it. Click the Modify menu, point to Templates, and then select the name of the region you want to find and select. Editable regions inside a repeated region do not appear in the menu. Saving Time by Using Templates Let's say that you've just created this huge Web site for your university (I volunteered to oversee the one for my university, and it wasn't pretty). Now, the project is completed, you unveil to the students and staff, and what happens: Well in my case one of the deans decided they didn't like the look of their section of the site, and another one decided that the graphics for her section were wrong. Understand everyone signed off on the design; however, things will happen. So, now all eyes are on me… I have to get this site up and running in a week, if we're to meet our deadlines for school enrollment. I looked about the room, asked each department head to give me their changes (in writing) by 5:00PM. The next day, when the faculty came in and checked the site all the changes were implemented (some people still weren't happy). How did I manage to change literally hundreds of Web pages in a single night (it actually took 3.5 hours)? How did I manage this great feat? Templates, my friend, templates. Design By Example From the Library of Wow! eBook ptg 448 Chapter 18 Attaching or Detaching a Template Attach and Detach a Template to a Page Open the Web page you want to apply the template to. Click the Modify menu, point to Templates, and then click Apply Template To Page. ◆ To detac h a pa ge f rom t he template, click the Modify menu, point to Templates, and then click Detach From Template. Select the template you want to apply. Click Select. ◆ You can also open the Assets panel, click the Templates category, select a template, and then click the Apply button. If the Inconsistent Region Names dialog box opens, content on the page cannot be automatically assigned to a template region. Select a destination for the content. Select a region in the new template or select Nowhere to remove the content. To move all unreso lv ed content to the selected region, click Use For All. Click OK. 7 6 5 4 3 2 1 If you didn’t create a new page based on a template, you can still attach (apply) the template to the file later. When you apply a template to a page file, Dreamweaver tries to match the existing content to a region in the template. You can apply a template to a page using menu commands from the Document window or from the Assets panel. If you no longer want a page to be based on a template, you can detach the page from the template. The page doesn’t lose any content, however, changes made to the template will not be applied to the page after it is detached. 4 3 7 6 5 From the Library of Wow! eBook ptg Chapter 18 Creating Templates 449 Importing XML into a Template Import XML into a Template Click the File menu, point to Import, and then click XML Into Template. Navigate to the drive and folder location where you want to import the XML file. Select the XML file you want to import. Click Open. Dreamweaver creates a new Web page based on the template specified in the XML file. The XML data in the file is placed in the editable region in the new Web page. 4 3 2 1 Dreamweaver provides an Import command for XML you can use to create a new document based on the template specified in an XML file. The command fills in the contents of each editable region in the new document using data from the XML file. If Dreamweaver has problems importing the data, the XML file might not have the right structure. To correct the problem, use the Export command for XML to view the file structure and then make the adjustments to the XML file you want to import. 2 3 4 From the Library of Wow! eBook ptg 450 Chapter 18 Exporting Template Data as XML Export Template Data as XML Open the template-based Web page with the data you want to export as XML. Click the File menu, point to Export, and then click Template Data As XML. Select the Notation option you want. ◆ Use Standard Dreamweaver XML Tags. Use this option if the template contains repeating regions or template parameters. ◆ Use Editable Region Names As XML Tags. Use this option if the template doesn’t contain repeating regions or template parameters. Click OK. Navigate to the drive and folder location where you want to export the data as an XML file. Type a name for the file, or use the suggested name. Click Save. 7 6 5 4 3 2 1 If you have data in a template that you want to use in another program, you can export the data as XML. The XML Export command creates an XML file with the data contained in your template’s editable regions and parameters. The exported XML file includes the name of the template and editable regions for round trip purposes. You can also use the XML Export command if you are having problems importing XML data into Dreamweaver. You can export data as an XML file in order to view the file structure and then make adjustments to the XML file you want to import. 5 6 7 4 3 From the Library of Wow! eBook . button. If the Inconsistent Region Names dialog box opens, content on the page cannot be automatically assigned to a template region. Select a destination for the content. Select a region. section of the site, and another one decided that the graphics for her section were wrong. Understand everyone signed off on the design; however, things will happen. So, now all eyes are on. XML. Select the Notation option you want. ◆ Use Standard Dreamweaver XML Tags. Use this option if the template contains repeating regions or template parameters. ◆ Use Editable Region Names As XML

Ngày đăng: 02/07/2014, 21:20

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan