Coding Drupal in Dreamweaver CS5
I've used big IDEs in the past: all the Drupal gurus/ninjas/whatever use Eclipse, Netbeans or something way over the top. My big project programming days are well and truly over - kicked the arse out of it over the years in BASIC, Pascal, FORTRAN, CORAL, ADA, Java and C++. When I started using Drupal to build websites, my aim was to avoid touching its underlying language, PHP. Managed that for 2 years, but recently have had to geek out to do a few cheeky things, either in the theming layer or some simple modules. My knowledge of PHP, jQuery and the Drupal API is pretty minimal, so need the following to write code:
- Code hints (for PHP, jQuery and the Drupal API)
- Code colouring (keep life simple)
- Basic syntax checking (not debugging)
- Integrated FTP and version control client.
Tried Smultron and TextMate, which are great, but can be a bit limited. With the relaunch of Adobe's Dreamweaver (version CS5) all of the above is now possible, with a load more CMS goodies (see http://www.adobe.com/products/dreamweaver - and there's an intro on lynda.com too). OK, you only get SVN support and no Git, but everything else on my list now works well.
Here's how to set up Dreamweaver:
- Find the Dreamweaver configuration files, MMDocumentTypes.xml (on OSX at /Applications/Adobe Dreamweaver CS5/Configuration/DocumentTypes) and Extensions.txt (on OSX at /Applications/Adobe Dreamweaver CS5/Configuration).
- In MMDocumentTypes.xml add file extensions to the PHP section (you'll need to scroll through the XML to find it):
<documenttype file="Default.php" id="PHP_MySQL" internaltype="Dynamic" macfileextension="php,php3,php4,php5,theme,module,engine,inc" servermodel="PHP MySQL" winfileextension="php,php3,php4,php5,theme,module,engine,inc" writebyteordermark="false">
- In Extensions.txt change the line ending in
: All Documentsto include
MODULE,THEME,ENGINE,INFO,INC,INSTALLand the line ending in
: PHP Filesand append the following extensions
- Open Dreamweaver and edit your preferences:
- Code format: indent with 2 spaces; Tab size to 2
- File Types/Editors - open
.module, .theme, .engine, .info, .inc, .installin code view (add to the list of existing extensions)