Accessibility
 
Home / Developer Center / Dreamweaver Developer Center /

Dreamweaver Article

Icon or Spacer Icon or Spacer Icon or Spacer
Murray Summers
Murray Summers
www.great-web-sights.com
 
Brad Halstead
Brad Halstead
dreamweavermx-templates
 
Using Parameters with Includes (SSI)

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

This tutorial shows you how you can do this and implement it with any server include document type (SHTML, CFML, PHP, ASP, JSP, and ASPX). Please note that since each language has its own include syntax and you must adjust this methodology accordingly.

Modifying 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;" -->


Note that /includes/NavA.inc is in the site root. Adjust the file and directory location to suit your setup. Notice that optional method 1 wraps the include name inside single quotes, whereas optional method 2 uses the ASCII value of &quot; on either side of the parameter value, and that the ASCII quote values are part of the parameter value.

To place the include, use the following syntax (this works in the head or body region of the template):
<!--#include virtual=@@(NavInc)@@-->

Notice that the include does not have quotes around the parameter.  If you use the quotes, the include will fail because the server 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
Use the following code for the child pages:

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

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

Making Changes in Dreamweaver MX or Contribute:
To edit the child page(s), use the following menu selection to change the value of the parameters that you previously specified:

In Dreamweaver MX, select Modify > Template Properties... and in Contribute, select Format > Template Properties...

Now template users can change the defined include parameter to refer to other includes that you have specified.

 

About the authors
Although a biochemist by training, Murray Summers has spent the last 20 years working in the computer industry. In 1998, Murray started his own website production company, Great Web Sights (www.great-web-sights.com) and he is the co-author of Dreamweaver MX Templates. As a Team Macromedia member, he also participates in the sponsored forums for Dreamweaver and other products. He lives in rural Philadelphia with Suzanne, his lovely wife, their 13-year-old daughter Carly, a Golden Retriever, a mixed retriever, an Eskipoo, and some goldfish.

Brad Halstead (www.dreamweavermx-templates.com), is a Computer Software Engineering Technologist by training, but deviated from that dream to join the Canadian Military as an Air Weapons Systems Technician where he learned all about various computerized Aircraft weapons systems as well as loading the munitions. Brad has dabbled in the web in various capacities since 1989 and left the Military to become a full-time Computer Technician. Brad tries to play an active roll in the support forums for Dreamweaver and Project Seven as time permits him to. He lives in London, Ontario with his cherished partner Brenda and their 9-year-old daughter Megan, 14-year-old daughter Amanda, 13-year-old son Aaron, and 2 Yorkshire Terriers (17-F and 13-M).