Jefe
Jefe

Reputation: 598

How do I get Dreamweaver to open the CakePHP view .ctp template files?

How do I open up the template files in Dreamweaver, without having to go through all the "open with" process? I've had problems getting this to work properly in Vista 64-bit, but have had this working in prior versions of Windows, so I know it's possible.

I'm working with CakePHP, so it uses the "ctp" extension, but I'm sure other frameworks have different extensions, so I decided to leave this as generic as possible.

Upvotes: 1

Views: 9156

Answers (2)

efarid08
efarid08

Reputation: 193

Modifying the Necessary Dreamweaver files There are 3 files that you need to edit. The first two are located in the folder that you have installed Dreamweaver, in my case It is in ‘C:\Program Files\Adobe\Adobe Dreamweaver CS3\configuration’. C:\Program Files\Macromedia\Dreamweaver 8\Configuration in case,if you are using Macromedia Dreamweaver 8 Open up ‘Extensions.txt’ and on the first line at the very end add THTML and CTP separated by commas,

so the line should read ,MASTER,THTML,CTP:All Documents Similarly add these two extensions to the ‘:PHP Files’ line. PHP,PHP3,PHP4,PHP5,TPL,THTML,CTP:PHP Files Next open the ‘DocumentTypes’ folder and edit the ‘MMDocumentTypes.xml’ file, just open it up using notepad/wordpad. Search for the line which has an id ‘PHP_MySQL’ and add the THTML/CTP file extensions to both the ‘winfileextension’ and ‘macfileextension’ so the line should read.

winfileextension=”php,php3,php4,php5,thtml,ctp” macfileextension=”php,php3,php4,php5,thtml,ctp” The final file is another version of the ‘Extensions.txt’ which is located in your ‘Documents and Settings’ Folder in my case this is ‘C:\Documents and Settings\Farid\Application Data\Adobe\Adobe Dreamweaver CS3\Configuration’ just add the very same things you inserted earlier. If you are using Macromedia Dreamweaver 8, you need not to do this edit.

for windows 7 you need to edit one more configuration file: C:\Users\AppData\Roaming\Adobe\Dreamweaver CS3\en_US\Configuration\extensions.txt edit just like the other extension files.

Upvotes: 2

jedmao
jedmao

Reputation: 10502

I found an excellent guide to this question that I've copied and pasted from the following link:

For Windows Vista (64-bit) instructions I just want to preface it with the following useful information and tips:

  1. Instead of "Program Files" use "Program Files (x86)".
  2. The location of AppData is quickly accessible by holding the [Windows key] (between CTRL and ALT) and pressing "R" for Run. This will give you a Run prompt, within which you should type "shell:appdata". This will give you a Windows Explorer window in your AppData folder. My Dreamweaver configuration file was found here: "C:\Users\Jed Hunsaker\AppData\Roaming\Adobe\Dreamweaver CS4\en_US\Configuration".
  3. Now is a good time to open another Run prompt and type "shell:sendto". Add shortcuts here to Notepad, Dreamweaver and why not Google Chrome and/or Firefox? Whatever you like.

Now for the pasted instructions in case that link above is broken when you read this:

For Configure/Opening CakePHP CTP Files in Dreamweaver 3 files that you need to edit:-

  • C:\Program Files\(Adobe or Macromedia)\(Adobe )Dreamweaver(version like 8 or cs3)\configuration

Open up “Extensions.txt” and on the first line at the very end add THTML and CTP separated by commas, so the line should read:

  • ,MASTER,THTML,CTP:All Documents

Similarly add these two extensions to the “:PHP Files” line.

  • PHP,PHP3,PHP4,PHP5,TPL,THTML,CTP:PHP Files

Next open the “DocumentTypes” folder and edit the “MMDocumentTypes.xml” file, just open it up using notepad or wordpad. Search for the line which has an id “PHP_MySQL” and add the THTML/CTP file extensions to both the “winfileextension” and “macfileextension” so the line should read:

  • winfileextension=“php,php3,php4,php5,thtml,ctp”
  • macfileextension=“php,php3,php4,php5,thtml,ctp”

The final file is another version of the “Extensions.txt” which is located in your “Documents and Settings” Folder in my case this is “C:\Documents and Settings(User_Name)\Application Data(Adobe or Macromedia)(Adobe )Dreamweaver(version like 8 or cs3)\configuration” just add the very same things you inserted earlier in “Extensions.txt” .

Upvotes: 3

Related Questions