Edit CakePHP's THML / CTP files with Dreamweaver

May 05, 2007

Note on July 15th, 2008: I haven’t used dreamweaver for a long time, this article was written back in cake 1.1 days.I suggest Text Mate for Mac OS X, and E Text Editor for Windows.


I needed Dreamweaver to recognize a new file extension called, “thtml” for CakePHP. Here is how I got Dreamweaver to recognize new code extensions and highlight them correctly:



  1. Edit your Extensions.txt file: C:\Documents and Settings\User\Application Data\Macromedia\Dreamweaver 8\Configuration

  2. Add in the new file extension into its type: HTM,HTML,HTA,HTC,XHTML, THTML:HTML Documents

  3. Now Dreamweaver recognizes the new file types but to get code highlighting you need to edit your MMDocumentTypes.xml file: C:\Program Files\Macromedia\Dreamweaver 8\Configuration\DocumentTypes

  4. Add in the new file extension to HTML winfileextension.

Here is the full article by Adobe: Adobe: Changing and adding file extensions recognized by Dreamweaver

14 comments

#1. Shannon ELs on November 03, 2009

Thank you for the information.

I tried it out and it did not work the first time, because I have no write privileges in my “Vista” Program Files, folder. If you follow the steps given above and it also does not work for you, then simply copy the Extensions.txt and the MMDocumentTypes.xml files to your desktop, edit them there, and replace(paste) the files back to their original folder.

#2. Ravi on May 05, 2010

If you are using cakePHP you will find files .thtml and .ctp and to open files with extension .thtml and .ctp in Adobe Dreamweaver you need to follow these steps:

  1. Open MMDocumentTypes.xml file inside folder (C:\Program Files\ your-dreamweaver-folder \Configuration\DocumentTypes)
  2. In line 67 which has id, PHP_MySQL add thtml/ctp extension on, winfileextension=“php,php3,php4,thtml,ctp” macfileextension=“php,php3,php4,thtml,ctp”
  3. Open file Extensions.txt inside folder (C:\Program Files\ your-dreamweaver-folder \Configuration)
  4. Add THTML,CTP at the first line seperated by comma at the very end so the command will look like ,THTML,CTP:All Documents
  5. Similarly add these two extensions to the “œ:PHP Files” line. so the command will look like, PHP,PHP3,PHP4,PHP5,TPL,THTML,CTP:PHP Files
    Now the final step
  6. Open file Extensions.txt inside folder (C:\Documents and Settings\Admin\Application Data\ your-dreamweaver-folder \Configuration)
  7. Add THTML,CTP at the first line seperated by comma at the very end so the command will look like ,THTML,CTP:All Documents
  8. Similarly add these two extensions to the “œ:PHP Files” line. so the command will look like, PHP,PHP3,PHP4,PHP5,TPL,THTML,CTP:PHP Files
  9. Finally, restart your dreamweaver and you should be able to run the files.
#3. dev on June 27, 2010

Thanks mate, helped me open/edit .ctp files directly!

#4. Prashant on July 03, 2010

Thanks freind..!!
Its great help…

#5. Prashant on July 03, 2010

Opppsssssssssssssssssssssssssssssssss…………
I restart my dreamveawer & its not working now…?
Why?

#6. Jesper on July 15, 2010

Or you can use “RJ TextEd” – To edit like all file types :-)

#7. Mani on August 17, 2010

you could always use notepad++ I love it :D

#8. Graham on October 14, 2010

what about mac – with regards to the final step: Open file Extensions.txt inside folder (C:\Documents and Settings\Admin\Application Data\ your-dreamweaver-folder \Configuration) – can’t find that file :(

#9. Graham on October 14, 2010

what about mac – with regards to the final step: – can’t find that file :(

#10. Lalit on October 30, 2010

Thanks u so much

#11. Chadi on November 14, 2010

On Windows 7 the second extensions file is in:
C:\Users\[YourUser]\AppData\Roaming\Adobe\Dreamweaver CS4\en_US\Configuration

#12. Anto on December 05, 2011

I did these things in documentTypes file but still i can not able to open .ctp in dreamweaver, What is the problem with this?

#13. pijno on January 03, 2012

Thanks #2 Ravi!

Most of the websites teaching how to open ctp in dw doesnt mention about the other extensions.txt in documents and settings folder.

#14. pijno on January 03, 2012

Thanks #2 Ravi!

Most of the websites teaching how to open ctp in dw doesnt mention about the other extensions.txt in documents and settings folder.

Leave a comment

Comment in textile images by gravatar