Written by me@grafxflow
15 Dec, 2013
4
5,865
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.
01 Jan, 2013
16 Oct, 2012
30 Oct, 2016
I am a Full-stack Developer who also started delving into the world of UX/UI Design a few years back. I blog and tweet to hopefully share a little bit of knowledge that can help others around the web. Thanks for stopping by!
Follow11 Jul, 2023
21 Jun, 2023
Views: 166,586
Views: 40,466
Views: 37,234
Views: 33,736
4 Response
paraz
11 Feb 2015
thank you very much.. it works...
Quin
05 Aug 2015
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?
me@grafxflow
05 Aug 2015
Hi Quin,
I can only think of 2 reasons this may happen.
Hope this helps.
Aleksandr
26 May 2016
thank you very much.. it works…