Adding file types to Dreamweaver CS4

Posted on February 17th 2010 11:36am Wednesday, by Blaine

By default Dreamweaver CS4 does not open, search, or syntax highlight some useful files types.  This article is going to go over how to support files such as .htaccess, .htpasswd, .phtml, .ctp and .trc files. These file types and I am sure many others can be syntax highlighted with html or php because they are template files for PHP engines. Besides right clicking on files and selecting open with Dreamweaver I needed a little more power from inside the application. Here are some tips on how to make Dreamweaver a little more developer friendly.

How to make files open in Dreamweaver by clicking on them

When trying to open a file type that is not added to Dreamweaver’s extension list it will error and say “Can’t find a valid editor for this file extension”. To make Dreamweaver open these files automatically just follow these menu instructions in Dreamweaver:

Edit > Preferences > File Types / Editors > Add extension to open in code view section

Make PHTML and other file types Syntax Highlighted

Windows 7/Vista: C:\Program Files (x86)\Adobe\Adobe Dreamweaver CS4\configuration\DocumentTypes\MMDocumentTypes.xml

Find the file mentioned above and open it. Then find the type of syntax highlighting you want and add the file extension to winfileextension and macfileextension. In this case we add PHTML files to be syntax highlighted with PHP. Edit the section referencing PHP and add PHTML to the list of file extensions. From there all you have to do is open Dreamweaver and PHTML files are now highlighted properly.

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

Searching PHTML files in dreamweaver cs4

Windows 7/Vista: C:\Users\YOUR USER\AppData\Roaming\Adobe\Dreamweaver CS4\en_US\Configuration\Extensions.txt

Finally, To make PHTML searchable in Dreamweaver you must edit another file. This file is much simpler to read and all you have to do is find the correlating file type (asp, php, xml, js, html, etc) and add the extension to that line. To have the extension PHTML searchable in Dreamweaver add it to the list with the PHP Files. Then open Dreamweaver and search.

PHP,PHP3,PHP4,PHP5,TPL,PHTML:PHP Files

The files will vary from OS to OS. If this article has helped you find the file but did not lead you directly to the file, comment below with your OS and the path to the file to help people.  I am not responsible for any damage this may cause.

Leave a Reply