This is by far the simplest method (in DWMX - may work in earlier version too)...

1. Open 'Dreamweaver Directory / Configuration / DocumentTypes? / MMDocumentTypes?.xml'

2. In the first 'documenttype' tag you just need to add 'tpl' to the list of file extensions (notice window and mac versions).

3. Restart Dreamweaver

DWMX will now treat all your .tpl files the same as .html files meaning you can edit them in code AND design view! You may not get fancy code colouring but it's still workable.

Simon Rycroft

Thanks to (Dave Labs)? for the following instructions:

Here is some documentation about getting DW to recognize other file types, such as .tpl:

http://www.macromedia.com/support/dreamweaver/ts/documents/add_ext_mx.htm

It's not too bad. I got it to work in a few minutes, even though I just started playing with DW myself (I'm used to non-WYSIWYG editors).

If you want to get color syntax highlighting it's a bit more involved: you need to edit the CodeColoring.xml and possibly Colors.xml in your Configuration directory (see caveat below):

1. In CodeColoring.xml, find the HTML scheme (near the top):

<scheme name="HTML" id="HTML" doctypes="ASP.NET_VB,ASP.NET_CSharp,A ...

If you've set DW to recognize TPL as an extension, you should add it here to the doctypes attribute.

2. Add a Smarty scheme to CodeColoring.xml. There is one attached below. To add it, just paste the attached file somewhere between the <codeColoring> </codeColoring> tags, after one of the existing <scheme> </scheme> elements.

If you want to set up your own Smarty colors, I believe it's possible to edit them within DW from a preferences menu somewhere. Or, you can dive into Colors.xml.

A caveat: DW installs "personal" copies of some of the config files in \Documents and Settings\<user>\Application Data\Macromedia\Dreamweaver MX\Configuration\...

These settings will _override_ the ones found in DW's Configuration directory, so change these files instead (and take a backup before doing so).

Suggested scheme for adding to the top of CodeColoring.xml, by Tom Sommer:

( Please remember that this requires that the current smartytags are { and } )

<scheme name="Smarty Template" id="Smarty_Template" priority="21">
	<ignoreCase>Yes</ignoreCase>
	<ignoreTags>Yes</ignoreTags>

	<blockStart name="Block Delimiter" id="CodeColor_PHPScriptBlock" doctypes="HTML" scheme="customText"><![CDATA[{]]></blockStart>
	<blockEnd><![CDATA[}]]></blockEnd>

	<brackets name="Bracket" id="CodeColor_JavaBracket"><![CDATA[([])]]></brackets>

	<commentStart name="Comment" id="CodeColor_PHPScriptComment"><![CDATA[*]]></commentStart>
	<commentEnd><![CDATA[*]]></commentEnd>

	<defaultText name="Text" id="CodeColor_PHPScriptVariables" />
	<defaultTag name="Other Tags" id="CodeColor_PHPScriptVariables" />
	<defaultAttribute />

	<stringStart name="String" id="CodeColor_PHPScriptString"><![CDATA["]]></stringStart>
	<stringEnd><![CDATA["]]></stringEnd>
	<stringStart><![CDATA[']]></stringStart>
	<stringEnd><![CDATA[']]></stringEnd>
	<stringEsc><![CDATA[\]]></stringEsc>

	<operators name="Operator" id="CodeColor_PHPScriptOperator"><![CDATA[+-*/%<>!?:=~^`.]]></operators>
	<numbers name="Number" id="CodeColor_PHPScriptNumber" />
	<idChar1>_$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</idChar1>
	<idCharRest name="Identifier" id="CodeColor_PHPScriptIdentifier">_$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789</idCharRest>

<keywords name="Reserved Keywords" id="CodeColor_PHPScriptReserved">
	<keyword>if</keyword>
	<keyword>/if</keyword>
	<keyword>else</keyword>
	<keyword>elseif</keyword>
	<keyword>false</keyword>
	<keyword>foreach</keyword>
	<keyword>foreachelse</keyword>
	<keyword>/foreach</keyword>
	<keyword>capture</keyword>
	<keyword>/capture</keyword>
	<keyword>section</keyword>
	<keyword>sectionelse</keyword>
	<keyword>/section</keyword>
	<keyword>include</keyword>
	<keyword>include_php</keyword>
	<keyword>insert</keyword>
	<keyword>literal</keyword>
	<keyword>ldelim</keyword>
	<keyword>rdelim</keyword>
	<keyword>strip</keyword>
	<keyword>/strip</keyword>
	<keyword>config_load</keyword>
</keywords>

<keywords name="Variables" id="CodeColor_PHPScriptVariables">
	<keyword>$smarty</keyword>
</keywords>

<keywords name="Functions" id="CodeColor_PHPScriptFunctionsKeywords">
	<keyword>assign</keyword>
	<keyword>counter</keyword>
	<keyword>cycle</keyword>
	<keyword>eval</keyword>
	<keyword>include</keyword>
	<keyword>fetch</keyword>
	<keyword>html_options</keyword>
	<keyword>html_select_date</keyword>
	<keyword>html_select_time</keyword>
	<keyword>math</keyword>
	<keyword>popup_init</keyword>
	<keyword>popup</keyword>
</keywords>

<sampleText doctypes="HTML,TPL"><![CDATA[]]></sampleText>

</scheme>

_____________________________

Go to http://tikiwiki.org/tiki-list_file_gallery.php?galleryId=8 and you'll find a Dreamweaver extension. Unpack the zip, double click the .mxp file, and you are done in 2 minutes.