An optional region is more or less a region that can be shown or hidden. This functionality can be determined either by the template author or the template
You can create an optional region in two ways: you can create it in the code view or you can create it in the Optional Region dialog box. The code you insert is a comment within the
portion of the HTML.
<!-- TemplateParam name="Name Something" type="Boolean" value ="false" -->
Code is also inserted into the area where you want the optional region to be placed. It looks something like this:
<!-- TemplateBeginIf cond="Name Something" -- >
<p><Content you wish to show or hide></p>
<!-- TemplateEndIf -- >
Of course, you would substitute "Name Something" with a name that makes more sense for the region, and you would actually have HTML that would add content to the document between the
Of course, this is Dreamweaver's WYSIWYG HTML editor, so you may just want to set it up through the dialog box. There is
less room for error that way. To insert an optional region in a template, follow these steps:
a template by double-clicking it in the Assets panel.
In the document, select the item you want to make an optional region.
With the item selected, choose Modify, Template Objects, Optional Region. You also can click the Optional Region button in the Insert panel under the Templates tab or contextual-click the object and in the context menu, choose Optional Region. This will open the New Optional Region dialog box, as shown in Figure 8.12.
Figure 8.12. The New Optional Region dialog box offers the options of creating statements to either hide or display the selected region.
With the Basic tab selected, type in a name for the optional region. It's important to name this region something that will make sense to you later on. You will have to refer to this region by this name in a template-based document.
If you want the region to appear, leave the Show by Default option selected; if not, uncheck that option. The user of the template will have the option of changing this value by selecting Modify, Template Properties. In the Template Properties dialog box, the user has the option of hiding or showing the optional area, as shown in Figure 8.13.
Figure 8.13. This dialog box offers options for updating pages both with library items and templates.
When you're happy with the settings, choose OK.