06
Sep
2009
Adding a file type for syntax highlighting in Dreamweaver
I develop most of my website applications with CakePHP which use view files with the file extension *.ctp. This means I lose syntax highlighting in Dreamweaver so I decided to add a new document type for syntax highlighting doing the following:
- Navigate to your dreamweaver directory
- Open the file ‘configuration/DocumentTypes/MMDocumentTypes.xml’
- Pick the syntax highlighting you want, in my case it was PHP so I searched for that extension in my XML doc.The line will look something like this
<documenttype id="PHP_MySQL" servermodel="PHP MySQL" internaltype="Dynamic" winfileextension="php,php3,php4,php5" macfileextension="php,php3,php4,php5" file="Default.php" writebyteordermark="false">
You’ll want to add the extensions you want where it says fileextension=”…”. The new line will look like this
<documenttype id="PHP_MySQL" servermodel="PHP MySQL" internaltype="Dynamic" winfileextension="php,php3,php4,php5,ctp” macfileextension=”php,php3,php4,php5,ctp” file=”Default.php” writebyteordermark=”false”>
- Save the file and restart Dreamweaver and you should be good to go!