15 Dec
2013

Open and colour code tpl files in Dreamweaver
I have tested this with Dreamweaver CS6, Dreamweaver CC, Dreamweaver CC 2014 and it works fine.
NOTE: Doesn't work in Dreamweaver CC 2017. It sadly has been completely removed by Adobe.
Files with the extension (tpl) by default aren't recognised by Dreamweaver. Plus when they do get opened in Dreamweaver they don't use the php code colouring even though they are just the same as a php file with a different extension.
So in order to do this you will need to edit some files on your Mac OS X or Windows, also make sure to quit Dreamweaver.
1. Lets start by telling Dreamweaver to recognise the files extension (.tpl), by opening and editing the following files.
Operating System |
File Directory |
---|---|
Mac OS X |
Users/ |
Vista/Win7 |
Users/ |
XP |
Documents and Settings/ |
and
Operating System |
File Directory |
---|---|
Mac OS X |
Applications/ |
XP/Vista/Win7 |
Program Files/ |
1.(a) First Add in TPL (in caps) to the first line changing...
HTM,HTML,SHTM,SHTML,HTA,HTC,XHTML,STM,SSI,JS,JSON,AS,ASC,ASR,XML,XSL,XSD,DTD,XSLT,RSS,RDF,LBI,DWT,ASP,ASA,ASPX,ASCX,ASMX,CONFIG,CS,CSS,CFM,CFML,CFC,TLD,TXT,PHP,PHP3,PHP4,PHP5,PHP-DIST,PHTML,JSP,WML,LASSO,JSF,VB,VBS,VTM,VTML,INC,SQL,JAVA,EDML,MASTER,INFO,INSTALL,THEME,CONFIG,MODULE,PROFILE,ENGINE,SVG,PRO:All Documents
... to
HTM,HTML,SHTM,SHTML,HTA,HTC,XHTML,STM,SSI,JS,JSON,AS,ASC,ASR,XML,XSL,XSD,DTD,XSLT,RSS,RDF,LBI,DWT,ASP,ASA,ASPX,ASCX,ASMX,CONFIG,CS,CSS,CFM,CFML,CFC,TLD,TXT,PHP,PHP3,PHP4,PHP5,PHP-DIST,PHTML,JSP,WML,TPL,LASSO,JSF,VB,VBS,VTM,VTML,INC,SQL,JAVA,EDML,MASTER,INFO,INSTALL,THEME,CONFIG,MODULE,PROFILE,ENGINE,SVG,PRO:All Documents
1.(b) Then further down where it says...
PHP,PHP3,PHP4,PHP5,PHP-DIST,PHTML:PHP Files
... just add TPL (in caps) again so it becomes
PHP,PHP3,PHP4,PHP5,TPL,PHP-DIST,PHTML:PHP Files
2. If you open Dreamweaver it should now recognise the tpl file format and open them with no issues. Now lets change the colour code settings so that instead of getting this...
... we get this.
So again quit Dreamweaver and start by opening the following files.
Operating System |
File Directory |
---|---|
Mac OS X |
/Users/
|
Vista/Win7 |
Users/ |
XP |
Documents and Settings/ |
and
Operating System |
File Directory |
---|---|
Mac OS X |
Applications/ |
XP/Vista/Win7 |
Program Files/ |
2.(a) At first change the following which should be at the top by deleting all instances of tpl and ini. So this...
<?xml version="1.0"?>
<documenttypes xmlns:MMString="http://www.macromedia.com/schemes/data/string/">
<documenttype id="HTML" internaltype="HTML" winfileextension="html,htm,shtml,tpl,ini,shtm,stm,lasso,xhtml" macfileextension="html,htm,shtml,shtm,lasso,tpl,xhtml,ssi" file="Default.html" writebyteordermark="false" mimetype="text/html">
... becomes.
<?xml version="1.0"?>
<documenttypes xmlns:MMString="http://www.macromedia.com/schemes/data/string/">
<documenttype id="HTML" internaltype="HTML" winfileextension="html,htm,shtml,shtm,stm,lasso,xhtml" macfileextension="html,htm,shtml,shtm,lasso,xhtml,ssi" file="Default.html" writebyteordermark="false" mimetype="text/html">
2.(b) Then around line 75 change this by adding tpl...
<documenttype id="PHP_MySQL" servermodel="PHP MySQL" internaltype="Dynamic" winfileextension="php,php3,php4,php5,phtml" macfileextension="php,php3,php4,php5,phtml" file="Default.php" writebyteordermark="false" mimetype="text/html">
... to
<documenttype id="PHP_MySQL" servermodel="PHP MySQL" internaltype="Dynamic" winfileextension="php,php3,php4,php5,phtml,tpl" macfileextension="php,php3,php4,php5,phtml,tpl" file="Default.php" writebyteordermark="false" mimetype="text/html">
Now simply quit Dreamweaver and open any tpl file and it should work and format just fine.


me@grafxflow
Visitors also viewed these posts
4 Thoughts
11 Feb
2015
paraz
thank you very much.. it works...05 Aug
2015
Quin
Hi - I've followed this exactly, and other sites give the same steps, but I still cannot colour co-ordinate the code.TPL was already in Extensions, and I've modified two MMDocumentTypes.
I honestly do not know what the problem is. Any ideas?
05 Aug
2015
me@grafxflow
Hi Quin,I can only think of 2 reasons this may happen.
Hope this helps.
26 May
2016
Aleksandr
thank you very much.. it works…