Dreamweaver Configuration

For Drupal users who are going to use Dreamweaver (DW) for their development or themes, here are some necessary tips:

  • A key issue when doing Drupal development in DW is that the software is unfamiliar with Drupal file-types or how to handle them, like ".module," ".install," and ".inc" suffixes should to be treated as PHP code, but it doesn't do this by default. You can read how to tweak Dreamweaver by hand or download an extension that adds Drupal file-types to Dreamweaver and helps treat them as native PHP files.
  • The coding standards tweak required is DW's default code preference of tabs rather than spaces. You can easily resolve this by following the directions below.
    • Go to "Edit » Preferences" and locate the category for "Code Format."
    • Check the "indent option and specify 2 "spaces."
    • Set "Tab size" to 2.
    • 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.

    Additional notes

    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 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.

 
 

Drupal is a registered trademark of Dries Buytaert.