Creating and Using Page Templates


If you created a page containing a standard layout that you want to use for a number of different pages, you can save it as a template. This feature is especially useful if you're working with a team of designers and you all want to use a set of shared templates. For example, if you're creating a Web site for a consulting business, you may want to create a separate Web page for each consultant where all consultant pages have the same basic layout, introductory text, and headings. You would create a consultant page template and then use it as the basis for creating each individual page.

Warning 

After you create a page from a template, the relationship between the page and the template ends. They meet, they create the page, they go their separate ways. If you then change the template and resave it, the pages you created based on the template aren't affected. For example, you may want to change the main picture for your consultant pages, but you already created several consultant Web pages. You have to not only change the picture on the template itself but also on each existing consultant page. (Any new pages made from the template do include the change.)

image from book
What goes into a template?

When considering what your page template should contain, think about which kinds of information will stay exactly the same on all pages and which pieces of information will vary. For example, if a block of text will always be in the same place and say the same thing, you should put it on the template. But if the text block will lookthe same but saysomething different, you can add a placeholder text block to the template, such as "Replace this text with consultant's bio" or, in a heading, "Consultant name goes here". Then, on the actual Web page, the person responsible for writing the text knows where to put it. In general, for everything that will vary on each page but appear in the same place and in the same format, create a placeholder for it. For every element that is exactly the same on all pages, add it to the template in its final form. Here are a few more examples of elements you may want to put on the template:

  • A picture (for example, a company logo or icon)

  • A main heading (for example, Meet Our Consultants)

  • An introductory paragraph that's the same on all pages using the template (for example, an overview of qualifications for all consultants)

image from book

Tip 

If you think you'll be using templates extensively, consider using Dynamic Web Templates rather than the page templates described in this section. Dynamic Web Templates stay linked to the pages created from them so that you can change the template and have Expression Web update specific pages or all pages in the Web site. We cover Dynamic Web Templates in detail in Chapter 11.

To create a template from a Web page, follow these steps:

  1. With the page you want to save as a template open in Expression Web, choose File image from book Save As.

    The Save As dialog box appears.

  2. In the Save as Type list box, choose Page Template (it's at the bottom of the list) and then click Save.

    The Save As dialog box closes, and the Save As Template dialog box appears.

  3. In the Save As Template dialog box, type a descriptive title in the Title text box.

  4. In the Name text box, type a filename.

    Just type a short word. Remember to keep filenames in all lowercase, and use underscores rather than spaces. Expression Web automatically applies the appropriate extension (.tem) to the filename you enter.

  5. In the Description text box, type a short description of the template's function.

  6. To create a shared template that other site authors can use when they're working on the Web site, select the Save Template in Current Web Site check box.

  7. Click OK.

    The dialog box closes, and Expression Web saves the page as a template. (The page visible in Expression Web is a regular Web page, so any additional changes you make aren't saved as part of the template.)

    If the page you're saving contains pictures, the Save Embedded Files dialog box appears. We explain how to use this dialog box in the sidebar "Saving pages containing pictures," earlier in this chapter.

After you create a template and save it, it's a snap to create a new page based on that template. Just follow these steps:

  1. Choose File image from book New image from book Page.

    The New dialog box appears, with the Page tab displayed.

  2. Click My Page Templates and then click the title of the page template you want to use.

    The list displays the titles you gave your template files when you saved them, and the description box shows your description. Expression Web even shows you a visual preview of what the selected template looks like so that you know you're picking the right one.

  3. Click OK.

    A new page appears in the editing window, with the elements from your template included on it.

  4. Save the page as you would any other Web page, by giving it a unique filename and page title.

Here are a few more tips for working with page templates:

  • Give your page templates meaningful titles and descriptions. This advice is especially important if you're working in a team.

  • If you find you need to make a lot of changes to a template after you already made several pages based on the template, you may find it easier to create new pages based on the changed template and then copy any page-specific information from the existing pages to the new ones. When working with an evolving Web site, you always have to balance which method is the most efficient.

  • If you find page templates too limiting, you can easily convert a regular page template into a Dynamic Web Template (DWT). See Chapter 11 for everything you need to know about Dynamic Web Templates.

  • You cannot attach an Expression Web page template to an already existing page (although you can attach a DWT to an existing page). You must use the template as the starting point.



Microsoft Expression Web for Dummies
Microsoft Expression Web For Dummies
ISBN: 0470115092
EAN: 2147483647
Year: 2004
Pages: 142

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net