Magento: PHTML Files In Dreamweaver

By default, Dreamweaver cannot display PHTML files correctly. You will notice that if you open a PHTML file it will be in black and white, making it harder to edit. So if you use Dreamweaver to develop your websites and would like to be able to view Magento’s PHTML files then you can follow some simple steps to allow Dreamweaver to display the files correctly for easier editing.

The following guide is for Dreamweaver on Windows (XP & Vista) and Mac OS X. If you are using a version of Dreamweaver earlier than CS3 then just replace Adobe with Macromedia where the file locations are.

Step One

XP: Open Documents and Settings > User > Application Data > Adobe Dreamweaver > Configuration > extensions.txt

Vista: Open Users > [user] > AppData > Roaming > Adobe > Dreamweaver 9 > Configuration > Extensions.txt

Mac OS X: Users > [Home Folder] > Library > Application Support > Adobe > Dreamweaver [Your Version] > [en_US or other locale (only for version CS4)] > Configuration > Extensions.txt

Then you need to add PHTML into the first line and in the PHP line as follows:

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

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

Step Two

This step is similar to step one but the extensions.txt file is located in Dreamweaver’s program files folder and inside a configuration folder.

XP & Vista: Program Files > Adobe > Dreamweaver [Your Version] > configuration > Extensions.txt

Mac OS X: Applications > Adobe Dreamweaver [Your Version] > configuration > Extensions.txt

Then add PHTML to the files in exactly the same way as step one:

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

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

Step Three

Now we need to fix the colour coding settings for the phtml files so the code will be easier to edit. This will be done with an xml file.

XP & Vista: Program Files > Adobe > Dreamweaver [Your Version] > configuration > DocumentTypes > MMDocumentTypes.xml

Mac OS X: Applications > Adobe Dreamweaver [Your Version] > configuration > DocumentTypes > MMDocumentTypes.XML

All you need to do is add phtml to the end of the following lines in the xml files:

winfileextension=”php,php3,php4,php5,phtml”
macfileextension=”php,php3,php4,php5,phtml”

Once you have done that, you can open or restart Dreamweaver and you will be able to see that the PHTML files look like standard HTML files.

Related posts:

  1. Install Magento Locally On A Mac
  2. Magento: Create XML Blocks
  3. Magento: Changing The Favicon
  4. Magento: Adding an RSS Feed
  5. Magento: Translate Inline

Tags: , ,

Leave a Reply

Contact Us Today...

For more information regarding any of our services or to arrange a free consultation simply send us a message or call 02920 290 080 for Cardiff and 01179 000 482 for Bristol.

Firefox 4 Beta

Mozilla have released the first beta version of Firefox 4. The latest version of this browser will include better support for many of the new web technologies, a new add on manager, crash protection from third party plugins and accelerated hardware support. One of the most obvious changes is that the tabs have now been moved [...]
» more

Cardiff: 02920 290 080 Bristol: 01179 000 482