5 Important Tools for Drupal Development


Published on

Published in: Education, Technology, Design
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • modules
  • Is familiar; it looks and acts like api.drupal.org
  • -Includes reference to contrib modules: Functions & methods, Source code -Includes many modules for D5, D6, D7, & D8
  • -User permissions control what user roles can use it -Admins intended role
  • -Hunting for the correct links and 4 page loads in the first example -A faster approach in the second -Allows you to get around a lot faster as an admin and perform everyday tasks
  • Small amount of shell experience Willingness to learn
  • -Information available online and inside README.txt in drush module -As well as many example use cases
  • -Can do this for many different drupal sites -Advanced setups can have different site aliases and site profiles to load different configurations for each specific Drupal install
  • -tip of the iceberg here -ways to quickly install brand new sites in 1 line of code that takes seconds -easily sync development sites to production sites
  • -Firebug for Drupal themeing. -Due to erratic behavior do not enable only for developing. -Turn on and off with drush makes it quick and easy!
  • -Drupal theme is built from many theming functions and templates we can call theming hooks. -Can be confusing to know what function in source is responsible for theme -this is where http://drupal.org/node/173880
  • -Drupal theme is built from many theming functions and templates we can call theming hooks. -Can be confusing to know what function in source is responsible for theme -this is where
  • -click on the link to template source for easy “Copy + Paste” as a base for new template -use candidate template files as naming reference for saving in theme directory -
  • -click on the link to template source for easy “Copy + Paste” as a base for new template -use candidate template files as naming reference for saving in theme directory -
  • 5 Important Tools for Drupal Development

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