Creating Optional Content


The optional content feature allows you to define whether the content is hidden or displayed in the pages based on the template. It enables you to set conditional or specific values for displaying content. You control these values through template parameters and conditional expressions.

You can create an optional content region to use certain elements in some template-based pages but not others. The capability to allow specific elements to be included on an individual basis gives your template a great deal of flexibility. Some pages, for example, might need illustrations and descriptions. You can create a table that controls the layout for such illustrations and descriptions and then define it as an optional content region. Documents based on the template will then provide you with the option to insert those regions or leave them out.

1.

In the teacher.dwt document, use the Tag selector to select the <td> for the table cell that contains teacherName Certifications and the nested table.

The selection looks grayed-out to indicate that it has been selected. This section will be optional on pages that use the teacher template.

2.

Click the Optional Region button in the Templates menu on the Insert bar.

The New Optional Region dialog box opens with the Basic tab active.

3.

In the Basic tab of the New Optional Region dialog box, uncheck the Show By Default box. Click OK to close the dialog box.

When creating your own Website, if the content you define as optional will be used on the majority of your pages, you should leave this box checked. In this lesson, however, only one of the pages will use this content, so it is easier when creating subsequent pages if this content is hidden by default.

In this example, you are using the default name for the optional region.

Note

If you already created an optional content region elsewhere on the page, the Advanced tab of the Optional Content dialog box lets you link that existing optional content region with the new one that you are creating. The Advanced tab also lets you create Template Expressions.

An optional region is not editable. You must define the area of the optional region that should be editable. This allows you to define only a portion of the area as editable, which you will do next.

4.

Select the text teacherName Certifications. Choose Editable Region from the Templates menu on the Insert bar, name the region teacherNameCert, and click OK.

When creating optional regions, all content within those regions will be locked until you define one or more editable regions.




Macromedia Dreamweaver 8(c) Training from the Source
Macromedia Dreamweaver 8: Training from the Source
ISBN: 0321336267
EAN: 2147483647
Year: 2006
Pages: 326

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