Using Parameters with Includes (SSI)

Wouldn't it be nice if you had several includes, each containing a different navigational method, that your site maintainers could use with templates in Contribute and Dreamweaver MX?

This tutorial shows you how you can do that and should work with any server include type (shtml, cfml, php, asp, jsp and aspx). Please note that each language has it's own include syntax and adjustments to this methodology will need to be made to accommodate.

Modifications to the template:

In the head region, add the following template parameter (typically just above the </head> tag:

Optional Method 1:
<!-- TemplateParam name="NavInc" type="text" value="'/includes/NavA.inc'" -->
Optional Method 2:
<!-- TemplateParam name="NavInc" type="text" value="&quot;/includes/NavA.inc&quot;" -->

Where /includes/NavA.inc is in the root of the site.. adjust to suit! Notice optional method 1 has the name of the include inside single quotes. Note that optional method 2 uses &quot; on either side of the parameter value and is part of the parameter value.

Now, where you want the include you would use (this works in the head or body region of the template):
<!--#include virtual=@@(NavInc)@@-->

Notice that the include is missing the quotes around the parameter.  If you use the quotes, the include will fail because it doesn't know how to handle the parameter inside.

Save the template and update the child pages or create a child page if none exist.

The child pages:

Optional Method 1 would produce output such as:
<!--#include virtual='/includes/NavA.inc'-->

Optional Method 2 would produce output such as:
<!--#include virtual="/includes/NavA.inc"-->

Making changes in Dreamweaver MX or Contribute:

The user editing the child page(s) would use the following menu item to change the content of the parameters previously specified:
Dreamweaver MX users: Modify» Template Properties...
Contribute users: Format» Template Properties...

Now your users of the template can make changes to the defined include parameter to reference other includes that you have specified to them.