|
|
|
Optional Regions
About optional regions
An optional region is a region in a template that can be set
to show or to hide in a template-based document. Use an optional
region when you want to set conditions for displaying content
in a document. You can set specific values for a template parameter
or define conditional statements in a template. Based on the
conditions you define a template users can edit the parameters
in documents they create and control whether the optional region
displays or not.
You can create template parameters and expressions in the Optional
Region dialog box or directly in Code view. When you use the
Optional Region template object, Dreamweaver inserts template
comments in the code.
A template parameter is defined in the head section:
<!-- TemplateParam name="departmentImage" type="boolean"
value="true" -->
At the location where the optional region is inserted, code
similar to the code below appears:
<!-- TemplateBeginIf cond="departmentImage" -->
<p><img src="/images/airfare_on.gif" width="85"
height="22"> </p>
<!-- TemplateEndIf -->
Template parameters you create for optional regions can be
accessed and edited in the template-based document by using
the Template Properties dialog box (Modify > Template Properties).
There are two optional region objects: one lets the template
author control which regions show and hide without letting a
user edit the content, while the other lets template users edit
content and set whether the region shows or hides.
|
|
|
|
Inserting an optional region
Use an optional region to control content which may or may not
be shown in a template-based document. An optional region is
controlled by a conditional statement. The template tab of an
optional region is preceded by the word if. Based on the condition
set in the template, a template user can define whether the
region is viewable in pages they create.
An editable optional region allows a template user to edit
the content in an optional region. For example, if the optional
region includes an image or text, the template user can set
whether the content is displayed, as well as make edits to the
content if desired. Editable regions are controlled by a conditional
statement. You create template parameters and expressions in
the Optional Region dialog box, or by typing parameters and
conditional statements in Code view.
To insert an optional region:
- In the Document window, select the element you want to set
as an optional region.
- Do one of the following:
- In the Insert bar, select the Templates category, then
select the Optional Region button.
- Choose Insert > Template Objects > Optional Region.
- Right-click the selected content, and in the context
menu select New Optional Region.
- Define options for the optional region.
- Click OK.
To insert an editable optional region:
- In the Document window, position the pointer where you want
the optional region inserted.
Tip: You cannot wrap a selection to create an editable optional
region. Insert the region, then insert the content in the
region.
- Do one of the following to open the Optional Region dialog
box:
- In the Insert bar, select the Templates category, then
select the Editable Optional Region button.
- Choose Insert > Template Objects > Editable Optional
Region.
- Right-click the selected content, and in the context
menu select Editable Optional Region.
The Optional Region dialog box appears.
- Define options for the optional region.
- Click OK.
|
|
|
|
Modifying an Optional Region
You can edit optional region settings after you’ve inserted
the region in a template. For example, you can change whether
the default for the content is set to show or not, link a parameter
to an existing optional region, or modify a template expression.
To reopen the Optional Region dialog box:
- Open the Property inspector, if it isn’t already open.
- In the Document window, do one of the following:
- In Design view, click the template tab of the editable
region you want to modify.
- In Design view, click content in the template region,
then in the tag selector click the template tag, <mmtemplate:if>.
- In Code view, click the comment tag of the template
region you want to modify.
- In the Property inspector, click Edit.
The Optional Region dialog box opens.
- Make the changes you want, then click OK.
1 > 2
> 3 > 4
> 5 > 6
> 7 > 8>
9 > 10
> 11 > 12
> 13
Next >
|
|
|
|
______________________________
Last updated: 6/28/02 • Webmaster: Paul
Young | |
|