Configuring Dreamweaver

Last updated on
30 September 2016

Adobe's popular Dreamweaver software can handle your PHP, template and CSS files just fine. And in some configurations (with XTemplate and PHPTAL) it can even offer graphical previews.

Drupal for Dreamweaver

XTND.US released a Drupal extension for Dreamweaver that provides editing of Drupal file-types (like .module, .install, .inc, .info, etc.), code coloring, and code hints for the Drupal API (5.x, 6.x). The extension from XTND.US eliminates the need to edit/configure Dreamweaver manually.

The extensions are good for developers and designers using Dreamweaver with Drupal. You can write your modules, module install schema files, install profiles, theme engines, template files, and even .info files.

NOTE: Some people may notice their .info files not uploading right and should use a separate FTP application to resolve upload errors in that scenario.

Other Configuration Tips

The coding standards tweak required is the default code preference of tabs rather than spaces. You can easily resolve this by following the directions below.

  1. Go to "Edit » Preferences" and locate the category for "Code Format."
  2. Check the "indent option and specify 2 "spaces."
  3. Set "Tab size" to 2.
  4. Save your changes.

While developing PHP code for Drupal in Dreamweaver, if you notice your code uses tabs (and not spaces) then you can fix any chunk of code by selecting code or select all (CTRL+A), then right click and choose "Selection;" then choose "Change tabs to spaces.", since you should plan to run your code through the Coder module then you will need to make sure that tabs were converted to spaces.

In the Preferences page, select "Code Coloring." Look for the "PHP" document type and then click the "Edit Coloring Scheme" button. Review the options. Try changing the "PHP Script Bracket" to a high contrast color (such as dark green or dark blue), but not black. This part is hard for some people to figure out.

Drupal coding standards call for no PHP ending tag ("?>"), but some may find that their Dreamweaver may demand it. You can develop with it in and will need to remember to remove it before testing, uploading, or committing.

Dreamweaver's "Apply source formatting" Command for PHP code may not be up to your standards, so make sure to try it out early at least to test.

Manually editing Dreamweaver's configuration

Find the Dreamweaver configuration files, MMDocumentTypes.xml and Extensions.txt, where they are depends on what platform is being used - the Find file function is your friend here.

For Dreamweaver CS3 you need to add the extensions by going to the edit menu > preferences. In the File Types/Editors section there is a place that identifies extensions you can "Open in Code View." Add the extensions listed below.

In Extensions.txt

Change the line ending in

: All Documents

to include


Likewise, add TAL,XTMPL to the line ending in : HTML files and MODULE,THEME,ENGINE,INC to the : PHP files line.

In MMDocumentTypes.xml

you likewise want to add tal and xtmpl file types to the file type descriptions, e.g. change the line beginging documenttype id="HTML" to be

<documenttype id="HTML" internaltype="HTML" winfileextension="htm,html,shtml,shtm,stm,tpl,lasso,xhtml,tal,xtmpl" macfileextension="htm,html,shtml,shtm,tpl,lasso,xhtml,tal,xtmpl" file="Default.html" writebyteordermark="false">

and likewise add .theme, .module and .engine to the appropriate section

<documenttype id="PHP_MySQL" servermodel="PHP MySQL" internaltype="Dynamic" winfileextension="php,php3,php4,php5,theme,module,engine,inc" macfileextension="php,php3,php4,php5,theme,module,engine,inc" file="Default.php" writebyteordermark="false">

The local copy of your site can now be edited in Dreamweaver.

Notes for Mac OS X

On OS X with CS3 installed, your Extension.txt is in

Macintosh HD/Users/{Your User Name}/Library/Application Support/Adobe/Dreamweaver 9/Configuration/

The MMDocumentTypes.xml is in

Macintosh HD/Applications/Dreamweaver CS3/configuration/DocumentTypes/

You might need to change the owner of this file (Right/Command Click + Get Info, Owner)

or in terminal
sudo chmod 777 MMDocumentTypes.xml

Related Dreamweaver Support Article

If you're interested in how Dreaweaver's file types can be tweaked then read this Adobe knowledgebase article (#tn_16410).

Third-party extensions