I love Dreamweaver. I use it for all my offline html, php, css, xml, etc, etc editing. When I started working with Magento, I was having to download the files using my favorite FTP client (Cyberduck), open them in Dreamweaver, save and then re-upload the file. Well, that is no more.

I remembered that Dreamweaver supported FTP for downloading/editing directly with Dreamweaver itself. So I though to myself, “Self, don’t you think that you should be able to just download and edit directly in Dreamweaver?” I answered myself, “Well, yes!” So I set out to figure out how to do it. It really wasn’t all that hard, all you have to do is connect to the FTP server within Dreamweaver, navigate to the file you want to edit, double click, and your off and running, editing away.

That’s when it happened. I kept getting an error when I tried to open .phtml files using FTP and Dreamweaver. It kept giving me the following error when it tried to open them, “Can’t find a valid editor for this file extension.” Mind you, I could download the files using my FTP Client, and open them, but I couldn’t open them directly from the Dreamweaver FTP. So, after some research, I was finally able to get it to work. Here’s how to do it.

The error occurs because Dreamweaver does not “natively” support .phtml files. It does not realize that the .phtml file extension is very similar to a .php or .html file. So you need to update some files within the Dreamweaver application support. (For a full breakdown on how to do this, check out this link from Adobe.)

Navigate to:
Macintosh HD/Applications/Adobe Dreamweaver CS3/configuration/DocumentTypes/MMDocumentTypes.xml and open it with TextEdit. What you are looking for here is . Right after that is where you add .phtml. In the macfileextension area (and the winfileextension area, if you want to) add phtml. It should look like this after you add it.

picture-11

There is one other file that needs to be updated. It is located in Macintosh HD/Users/[your user name]/Library/Application Support/Adobe/Dreamweaver 9/Configuration/Extensions.txt. On the 2nd (or 3rd) line, the file references many HTML file types. It looks like this. HTM,HTML,HTA,HTC,XHTML:HTML Documents. It should be obvious as to what to do, just add ,PHTML to the end of the string, but before the :HTML Documents. (Be sure to include the comma and to put PHTML in all caps.)

Restart Dreamweaver, and you now have full support, including syntax highlighting, to be able to open .phtml directly from FTP into Dreamweaver.

Alternatively, you can download the files attached (below) and place them in their respective folders as outlined above. Just replace your existing files with these.

By the way, the reason I put this out instead of just referring back to the Magento site is because they explain how to make .phtml behave like .php files instead of .html.

Links:

http://www.magentocommerce.com/wiki/how-to/working_with_phtml_and_dreamwearver

http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16410

http://cyberduck.ch/

Files:
MMDocumentTypes.xml & Extensions.txt
md5:86ce53961765ffd43e16127f5597cef6