Drupal development
needs refactoring to work with theming
Basics
- Drupal's basic building blocks - the search for core, Ronald Ashri, Nov 2009
- Drupal programming from an object-oriented perspective
- Drupal as an Application Development Framework - great dev overview video, shame about the audio
Architecture
- Drupal dev docs - "Newcomers to Drupal development should read the conceptual information provided in the 'Components of Drupal' section, and then proceed to examine one of the heavily-documented example modules below. The examples are fully-functioning Drupal modules, so you can download them from the contributions repository and alter them as you experiment."
- Preying on the drupal_alter() - API overview video. somewhat quiet sound. [1]
Hooks
"Drupal's module system is based on the concept of "hooks". A hook is a PHP function that is named foo_bar(), where "foo" is the name of the module (whose filename is thus foo.module) and "bar" is the name of the hook. Each hook has a defined set of parameters and a specified result type.
"To extend Drupal, a module need simply implement a hook. When Drupal wishes to allow intervention from modules, it determines which modules implement a hook and calls that hook in all enabled modules that implement it."
Menu system (path)
- How the menu system works (a Drupal how-to) - how the menu system translates paths to callback functions
Content
An entity is a kind of content stack. An entity base table is tied to fields using bundles. Entity types include node, comment, taxonomy term, user profile, organic group, etc. Entity types can allow bundling or not (creating types of node node vs. users, though see the Profile 2 module). Fields are used to store and display various data types, and can be reused across bundles and entities.
- http://www.slideshare.net/ronald_istos/drupal-entities-emerging-patterns-of-usage
- http://www.slideshare.net/erikwebb/drupal-7-and-entities-7036807
hook_entity_info - "Inform the base system and the Field API about one or more entity types."
- http://www.trellon.com/content/blog/creating-own-entities-entity-api
- http://www.slideshare.net/ronald_istos/how-to-make-entities-and-influence-drupal-emerging-patterns-from-drupal-contrib
- http://bxl2011.drupaldays.org/node/313 - fago
Creating
Modules
- Beginning Drupal Module Development or How I Wrote the Cacheflusher Module (Part 2) - has a good hook overview from a module perspective
- http://drupal.org/project/examples - various examples
- http://drupal.org/project/coder - use when writing modules
- http://drupal.org/project/drupalcs - code sniffer
Patches
Forms
For beyond basic content types field layouts;
- http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/7 - programmer's reference to the Drupal Form API
function milk_form_alter(&$form, &$form_state, $form_id) { if ($form_id == 'contact_node_form') { $form['actions']['submit'] = array( '#type' => 'submit', '#value' => t('Send'), ); } }
- http://www.advomatic.com/blogs/jack-haas/notable-changes-to-theming-drupal-7 Notable changes to theming in Drupal 7] - Form Overrides section has another perspective on the basics
Menus
"The Drupal menu system drives both the navigation system from a user perspective and the callback system that Drupal uses to respond to URLs passed from the browser. For this reason, a good understanding of the menu system is fundamental to the creation of complex modules. As a note, this is related to, but separate from menu.module, which allows menus (which in this context are hierarchical lists of links) to be customized from the Drupal administrative interface."
- How to use images for menu items in Drupal with a simple preprocessing function - using theme_menu_item_link for a specific item
JavaScript
<?php drupal_add_js(drupal_get_path('theme', 'mytheme') .'/my_js_file.js', 'theme'); ?>
- Drupal 7 JavaScript for Developers - good video