Blog

15 Dec
2013

Dreamweaver cc logo

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/
[Your Username]/
Library/
Application Support/
Adobe/
Dreamweaver [Your Dreamweaver Version]/
en_US/
Configuration/
Extensions.txt

Vista/Win7

Users/
[Your Username]/
AppData/
Roaming/
Adobe/
Dreamweaver [Your Dreamweaver Version]/
Configuration/
Extensions.txt

XP

Documents and Settings/
[Your Username]/
Application Data/
Dreamweaver [Your Dreamweaver Version]/
Configuration/
Extensions.txt

and

Operating System

File Directory

Mac OS X

Applications/
Adobe Dreamweaver [Your Dreamweaver Version]/
Configuration/
Extensions.txt

XP/Vista/Win7

Program Files/
Adobe/
Adobe Dreamweaver [Your Dreamweaver Version]/
Configuration/
Extensions.txt

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...

tpl_before

... we get this.

tpl_after

So again quit Dreamweaver and start by opening the following files.

Operating System

File Directory

Mac OS X

/Users/
[Your Username]/
Library/
Application Support/
Adobe/
Dreamweaver [Your Dreamweaver Version]/
en_US/
Configuration/
DocumentTypes/
MMDocumentTypes.xml

Vista/Win7

Users/
[Your Username]/
AppData/
Roaming/
Adobe/
Dreamweaver [Your Dreamweaver Version]/
Configuration/
DocumentTypes/
MMDocumentTypes.xml

XP

Documents and Settings/
[Your Username]/
Application Data/
Dreamweaver [Your Dreamweaver Version]/
Configuration/
DocumentTypes/
MMDocumentTypes.xml

and

Operating System

File Directory

Mac OS X

Applications/
Adobe [Your Dreamweaver Version]/
Configuration/
DocumentTypes/
MMDocumentTypes.xml

XP/Vista/Win7

Program Files/
Adobe/
Dreamweaver [Your Dreamweaver Version]/
configuration/
DocumentTypes/
MMDocumentTypes.xml

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.

Posted in: < PHP and HTML and CSS >
me@grafxflow avatar

me@grafxflow


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!

Visitors also viewed these posts

4 Thoughts

  1. 11 Feb
    2015

    avatar

    paraz

    thank you very much.. it works...
  2. 05 Aug
    2015

    avatar

    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?
  3. 05 Aug
    2015

    avatar

    me@grafxflow

    Hi Quin,

    I can only think of 2 reasons this may happen.


    1. You have not deleted the 'tpl' like above section 2.(a).

    2. Or Dreamweaver has reset the above file so change it again as 2.(a).



    Hope this helps.
  4. 26 May
    2016

    avatar

    Aleksandr

    thank you very much.. it works…

Add comment

Add comment