• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 15. Working with Templates > Defining Optional Regions

Defining Optional Regions

Optional regions are some of the more powerful customizable regions. Optional regions allow you to list multiple options, such as images, within a region on the template and then allow the user of the template-derived page to determine which image he or she wants to use. To further understand how the optional region can be beneficial to a template, think about our Dorknozzle organization. Currently, we specify an image placeholder in the Main subheading's editable region. We automatically assume that the department web developer will browse the company's directory of images (tedious work, by the way) and find the appropriate image to place in that area. Technically, there's nothing preventing the department web developer from selecting a custom image that he created to put into that spot instead. By creating an optional region in this spot instead of an editable region, we get to dictate which images the developers can choose from. For instance, in the Images folder, we have three versions of the subheader image: subheader_engineering.gif, subheader_marketing.gif, and subheader_sales.gif. We could easily replace the Main Subheading editable region with three optional regions, effectively forcing the department web developer to pick one of the three. To demonstrate how this is done, follow these steps:

Close any open documents and reopen the template.dwt file.

Delete the existing Main Subheading editable region by selecting it and pressing Delete.

With your cursor still in the cell, choose Insert, Template Objects, Optional Region. The New Optional Region dialog appears, similar to Figure 15.18.

Figure 15.18. The New Optional Region dialog allows you to establish an optional region in the template.

The dialog is split into two tabs: Basic and Advanced. Although we'll discuss the Advanced tab later, for now make sure that the Basic tab is selected.

On the Basic tab, you have the option of defining the name for the optional region as well as defining whether that region will display by default when the user opens the template-derived page for the first time. Enter the text Main SubMarketing into the Name text box and disable the Show by Default check box.

Click OK.

Replace the text in the optional region with the subheader_marketing.gif image located in the Images folder.

Place your cursor next to the newly created optional region and perform steps 3 through 7 over again for both the engineering and sales images. When you've finished, the page should resemble Figure 15.19.

Figure 15.19. Add two more optional regions and two new images for engineering and sales.

Save your work and update the pages that use the template.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint