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: