Drupal is a content management system and a web development platform. With a small set of core modules and a large ecosystem of community contributed modules, it can be used fro a variety of use cases including corporate intranets, social web applications, online publishing, and education or government websites. In this talk, we’ll cover the benefits of using Drupal for developers, and how to use and extend Drupal as a web development framework.
Besides being open source and having an active development-driven community, Drupal has many architectural advantages. We’ll discuss these benefits including the hook system, separation of theme and module layers, the emphasis on flexible content architecture, the database integration layer, and Drupal’s coding standards. We’ll also introduce some tools to get you started on the right track, improve the performance of your Drupal projects, and avoid mistakes.
2. About Me
• Drupal consulting,
development, and
training
• Help organizations
build awesome
Drupal sites + apps
• Specialize in
multilingual Drupal
and Apache Solr
14. Content Types
Nodes can have different fields + settings
Event Blog Post
• Date • Author + Date
• Location Published
• Description • Body Text
• Signup List • Comments
42. Entity Types
Entity types are classes that define content
Content Users Taxonomy Comments
Content title D. Schrute
adventure Wow, can't
Germany city breakwait to get
dwight
city break 8 Sept started.
J. Halpert
Spain sailing
joe Me too!
shopping 8 Sept
69. How hooks are
implemented
Any module can implement a hook as follows:
function <module_name>_<hook_name>(args) {
//possibly alter an argument
//possibly return something
}
70. Example: hook_init()
/**
* Implementation of hook_init()
*
* Do stuff on the front page
*/
function my_module_init() {
if (drupal_is_front_page()) {
drupal_set_message('Front page message!');
}
}
71. Alter Hooks
• Modify data generated in other
modules before it gets rendered
• Examples:
• hook_form_alter()
• hook_mail_alter()
• hook_menu_alter()
• hook_menu_link_alter()
72. Form API - benefits
• No more HTML generation!
• Data validation
• Security checks, caching
• Code reuse (custom elements, form
altering)
• AJAX
78. Submission
• Simple '#type' =>
'submit' element
• Submit buttons can
have their own
submit function,
allowing different
buttons to do
different things in a
simple way.