Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

Opening PHTML Files in Dreamweaver

Last modified by xTasMe on Fri, November 21, 2008 08:18
Source|Old Revisions  

Opening PHTML Files in Dreamweaver

By default, Dreamweaver cannot read PHTML files. You can add the file type to the “Open in Code View” section of the preferences if you wish to have fast access, however you cannot view the file in design view if you do that. So if you use Dreamweaver (versions 4, MX, MX2004, 8, or 9, aka CS3,CS4) to design your sites, and you wish to open Magento’s Template files (they have .phtml extensions) in Dreamweaver, you can follow these steps to add support for .phtml and make Dreamweaver render PHP code (with coloring, hinting, et al) as well as allow you to see the design in code view if desired. Below are three steps to follow.*

IMPORTANT NOTES: This guide is for Dreamweaver on Windows (XP or Vista) or Mac OS X. Note: I have excluded version numbers from the file locations shown, and if you are using a version older than Dreamweaver 9 (CS3) replace “Adobe” with “Macromedia” in the file locations shown. Some spaces have also been removed to keep the references on one line.

* Dreamweaver 4 users: if you are using the archaic Dreamweaver 4, you only need to follow step one. However, it’s highly recommended that you just upgrade to version 8, CS3 or newer for superb CSS and Web Standards support.

*With Dreamweaver 8, this tip didn’t work for me, so I repeated Step 3 here: “C:Documents and Settings > [user name] > Application Data > Macromedia > Dreamweaver 8 > Configuration > Document Types > MMDocumentTypes.xml” and PHTML finally worked in both Design View and Code view.

*In Vista it was only possible to edit the following files by running notepad as Administrator. Go to Start > All Programs > Accessories, and then right click on notepad and select “Run as Administrator” then once notepad is open, use File > Open to browse to the applicable file.

Step One: Add .phtml to extension.txt in your Application Data

Open the following extension configuration file in a notepad and change the lines as specified below:

XP: C:Documents and Settings > [user] > Application Data > Adobe Dreamweaver > Configuration > extensions.txt

NOTE: If you cannot see the Application Data Folder, go to Tools → Folder Options → View and make sure that Show Hidden Files and Folders is checked.

Vista: C:Users[user]App Data > Roaming > Adobe Dreamweaver > Configuration > Extensions.txt

Mac OS X: Users > Library > Application Support > Adobe > Dreamweaver 9 > Configuration > Extensions.txt

In the first line add PHTML like so:

HTM,HTML,SHTM,SHTML, ... ,TXT,PHP,PHP3,PHP4,PHP5,PHTML,JSP,WML,TPL, ... ,MASTER:All Documents

In the PHP Files line add PHTML like so:

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

Step Two: Add .phtml to the extension.txt configuration file

This file is pretty much exactly like the extensions.txt file located in Dreamweaver’s Application Data folder, except it is in Dreamweaver’s Program Files folder, inside a configuration folder. Just as in Step One, find the file and change the lines as specified below.

XP, Vista: C:Program Files > Adobe Dreamweaver > Configuration > Extensions.txt

Mac OS X: Applications > Adobe Dreamweaver CS3 > configuration > Extensions.txt

In the first line add PHTML like so:

HTM,HTML,SHTM,SHTML, ... ,TXT,PHP,PHP3,PHP4,PHP5,PHTML,JSP,WML,TPL, ... ,MASTER:All Documents

In the PHP Files line add PHTML like so:

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

Step Three: Add PHTML to MMDocumentTypes.xml

This file is an XML file which should be located in:

XP, Vista: C:Program Files > Adobe Dreamweaver > Configuration > DocumentTypes > MMDocumentTypes.XML

Mac OS X: Applications > Adobe Dreamweaver CS3 > configuration > DocumentTypes > MMDocumentTypes.XML

Add PHTML to this line (approx. line 75) twice, like so:
<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">;
</documenttype>

Restart or Open Dreamweaver and you shouldn’t have any problems with PHTML files any longer.




 

Popular Wiki Tags  |  View all

 module   routes   data accessing   list   resource   action   backend   api   controller   mysql4   getModel   php   Mage API   attribute   eav 

Professional Services from the Magento Team

Professional Installation from the Magento Team

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
50115 users|438 users currently online|102252 forum posts