Template Parameter Types

As you may or may not know, the F1 help files leave a little to be desired with respect to understanding template parameters. In a few cases, these files are just wrong.

These help files refer to a parameter type of STRING - a clear error, since there is no such parameter type.

Below is the quick list of available template parameter types that Dreamweaver MX recognizes:

<!-- TemplateParam name="SampleBoolean" type="boolean" value="true|false" -->
<!-- TemplateParam name="SampleColor" type="color" value="#000000" -->
<!-- TemplateParam name="SampleNumber" type="number" value="1" -->
<!-- TemplateParam name="SampleText" type="text" value="Some Text" -->
<!-- TemplateParam name="SampleURL" type="URL" value="images/mypic.gif" -->

There are three methods of insertion of a template parameter in your template:

Method A:

By Hand, manually typing one or more of the above lines in the head region of your template or nested template.

Method B:

By inserting a region, whose type dictates the requirement of a template parameter.

This would include an Optional Region or a template expression.

Method C:

Notes:

  1. When inserting an Optional Region, the Boolean type is used by default.  If another type is required, you will have to manually change it in code view to the desired type and value.
  2. All other parameter types, as well as boolean (labeled true/false), are available when defining Editable Tag Attributes and can be selected from the Editable Tag Attribute's UI.

Parameters and expressions are given quite a thorough presentation in our book.  Specifically, chapter 3 where they are discussed and in Chapters 6 though 8 where they are put to practical use by example.