5 important tools for drupal development
TRANSCRIPT
![Page 1: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/1.jpg)
5 Important Tools for Drupal DevelopmentJuly 14, 2011
![Page 2: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/2.jpg)
5 Important Tools for Drupal Development
Overview• A talk of 5 tools to aid you in
developing, administering, and maintaining Drupal sites.
Goals• Spark an “ah hah!” moment• Introduce new ideas and techniques• Get you excited about Drupal
ANTHOLOGYMARKETING.COM
![Page 3: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/3.jpg)
DRUPALCONTRIB.ORGTOOL #1
ANTHOLOGYMARKETING.COM
![Page 4: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/4.jpg)
Contrib is
• how Drupal is extended and customized.
• made up of 8292 modules today.
• written by the community and shared under the same GNU Public License (GPL) as Drupal.
• not shipped with Drupal core releases.
• shaping future releases of Drupal.
ANTHOLOGYMARKETING.COM
![Page 5: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/5.jpg)
drupalcontrib.org
• Search contrib modules
ANTHOLOGYMARKETING.COM
![Page 6: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/6.jpg)
Contrib API reference
ANTHOLOGYMARKETING.COM
![Page 7: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/7.jpg)
Add modules to documentation
ANTHOLOGYMARKETING.COM
![Page 8: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/8.jpg)
ADMINISTRATION MENUTOOL #2
ANTHOLOGYMARKETING.COM
![Page 9: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/9.jpg)
A simple administrative interface
• The menu is theme independent• CSS-based drop down style menu• Eliminates unnecessary page loads and clicks• For D6, D7
ANTHOLOGYMARKETING.COM
![Page 10: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/10.jpg)
A comparison
Create a new CCK field for a custom content type
• Workflow #1 – without administration menu• Workflow #2 – with administration menu
ANTHOLOGYMARKETING.COM
![Page 11: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/11.jpg)
Workflow example #1
1. Click on Administer
ANTHOLOGYMARKETING.COM
![Page 12: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/12.jpg)
Workflow example #1
2. Click Content Types
ANTHOLOGYMARKETING.COM
![Page 13: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/13.jpg)
Workflow example #1
3. Click manage fields
ANTHOLOGYMARKETING.COM
![Page 14: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/14.jpg)
Workflow example #1
4. Find desired field row and click on configure
ANTHOLOGYMARKETING.COM
![Page 15: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/15.jpg)
Workflow example #2
1. Navigate the admin menu until you find the desired field and click on configure
ANTHOLOGYMARKETING.COM
![Page 16: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/16.jpg)
DRUSHTOOL #3
ANTHOLOGYMARKETING.COM
![Page 17: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/17.jpg)
What is drush?
• Drupal + shell = Drush
• Drush is a command line shell and scripting interface for installing, developing, and maintaining Drupal sites.
• Intended Users– Developers– Admins
ANTHOLOGYMARKETING.COM
![Page 18: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/18.jpg)
Requirements
Server• CLI-mode capable PHP binary, PHP 5.2 or greater• Drupal 5.x-2.5 or later• SSH access
ANTHOLOGYMARKETING.COM
![Page 19: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/19.jpg)
Installation
Download (and extract):
~ $ wget http://ftp.drupal.org/files/projects/drush-7.x-4.4.tar.gz
ANTHOLOGYMARKETING.COM
Make sure drush is executable:
~ $ chmod u+x /path/to/drush/drush
Add Alias to ~/.bashrc:
~ $ alias drush=‘/path/to/drush/drush’
Reload bash and type drush:
~ $ drush
![Page 20: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/20.jpg)
Using Drush
Navigate to Drupal site folder:
~ $ cd /path/to/drupal/web
ANTHOLOGYMARKETING.COM
Check site status:
~ $ drush status Drupal version : 6.22 Site URI : http://default Database driver : mysqli Database hostname : localhost Database username : drupaluser Database : Connected Drupal bootstrap : Successful etc…
![Page 21: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/21.jpg)
Example use cases
Download (and extract) views module:
~ $ drush dl views
ANTHOLOGYMARKETING.COM
Clear site cache:
~ $ drush cc
Run cron:
~ $ drush cron
Update core, enabled modules, and database:
~ $ drush up
![Page 22: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/22.jpg)
DEVEL THEMERTOOL #4
ANTHOLOGYMARKETING.COM
![Page 23: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/23.jpg)
Devel Themer
• Theming tool• Depends on Devel• No current stable
release due to erratic behaviors in less stable browsers
• Turn on/off with drush• For D6, D7
ANTHOLOGYMARKETING.COM
![Page 24: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/24.jpg)
Drupal Theme
ANTHOLOGYMARKETING.COM
http://drupal.org/node/173880
![Page 25: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/25.jpg)
Drupal Theme
ANTHOLOGYMARKETING.COM
http://drupal.org/node/173880
![Page 26: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/26.jpg)
Devel Themer in action
• Theme hierarchy• Template information• Link to template
source file• Possible names of
overriding template files
ANTHOLOGYMARKETING.COM
![Page 27: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/27.jpg)
Remember
ANTHOLOGYMARKETING.COM
• Enable/Disable devel_themer with drush• After enabling, refresh your browser to load the themer• Check box turns themer on• Hover over elements on the page• Use suggested overrides and naming conventions• Clear cache and test theme
![Page 28: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/28.jpg)
DRUPAL FOR FIREBUGTOOL #5
ANTHOLOGYMARKETING.COM
![Page 29: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/29.jpg)
Drupal for Firebug
• Extends the Firefox browser plugin, Firebug– http://getfirebug.com/
• Enhancing Drupal debugging through the browser console.
• Provides insight into node, form, user objects• Works with Devel module to display SQL queries and
execute PHP from the browser• Also works with Views if installed
ANTHOLOGYMARKETING.COM
![Page 30: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/30.jpg)
Installing Drupal for Firebug
• Install Firebug– http://getfirebug.com/
• Install Drupal for Firebug Add-on:– https://addons.mozilla.org/en-US/firefox/
addon/drupal-for-firebug/
• Install Drupal for Firebug module:– http://drupal.org/project/drupalforfirebug
ANTHOLOGYMARKETING.COM
![Page 31: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/31.jpg)
Viewing objects
• Visualize the processing of objects– First the node is loaded– Then ready to be viewed– Then altered by modules
ANTHOLOGYMARKETING.COM
![Page 32: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/32.jpg)
Helping developers
• Developers can write to firebug log!
• Example use in custom module:
ANTHOLOGYMARKETING.COM
function firep($element, $title = NULL)
http://jbenner.net/blog/drupal-for-firebug
![Page 33: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/33.jpg)
Now available for Chrome!
• Use your preferred developing browser!
ANTHOLOGYMARKETING.COM
![Page 34: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/34.jpg)
Resources
Drupal API Reference• Drupal core: http://api.drupal.org• Drupal contrib: http://drupalcontrib.org
Administration Menu• Project page: http://drupal.org/project/admin_menu• Demo: http://www.youtube.com/watch?v=3YgnIFi73QI
ANTHOLOGYMARKETING.COM
![Page 35: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/35.jpg)
Resources
Drush• Project page: http://drupal.org/project/drush• Home page: http://drush.ws• Installation: http://openspring.net/tip/how-to-install-drush-
serverwide-in-less-than-one-minute
Devel Themer• Project page: http://drupal.org/project/devel_themer• Themable output: http://drupal.org/node/173880• Template preproccess: http://drupal.org/node/223430
ANTHOLOGYMARKETING.COM
![Page 36: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/36.jpg)
Resources
Drupal for Firebug• Firebug: http://getfirebug.com/• Firefox Add-on:
https://addons.mozilla.org/en-US/firefox/addon/drupal-for-firebug/
• Chrome Add-on: https://chrome.google.com/webstore/detail/imlijcpfmhmifofiihbofoamohkdbblc
• Project page: http://drupal.org/project/drupalforfirebug• Review: http://jbenner.net/blog/drupal-for-firebug
ANTHOLOGYMARKETING.COM
![Page 37: 5 Important Tools for Drupal Development](https://reader035.vdocuments.site/reader035/viewer/2022062418/55510dcbb4c9052d0e8b4674/html5/thumbnails/37.jpg)
Questions?
ANTHOLOGYMARKETING.COM