1. Form Alterations - Getting What
You Want in Drupal Without
Hacking
Presented by Mark W. Jarrell Drupal/Twitter username: attheshow
June 28, 2009 Http://fleetthought.com
Sunday, June 28, 2009
2. What are we talking about?
✤ This is a “how to” session
✤ Modify form elements in Drupal
created by either core modules or
contributed modules you’ve
installed
Sunday, June 28, 2009
3. Why do we need to alter forms?
✤ Custom functionality for our sites
✤ Gives us more control over how
things appear in our forms
✤ Can be used to increase efficiency
for users entering things into
Drupal’s forms
✤ Example: Prepopulating the
domain part of the email address
for our admin who’s adding new
users.
Sunday, June 28, 2009
4. Why not just hack it?
✤ Maintaining something that’s hacked is difficult.
✤ When you upgrade, you may lose your changes.
✤ Other community members can help you because your system conforms to
Drupal standards.
Sunday, June 28, 2009
5. What do we need to make it
happen?
✤ Devel module
http://drupal.org/project/devel
✤ Gives us a great function for
inspecting forms (dsm())
✤ Build a custom module
✤ We’ll call ours “dcc09”
Sunday, June 28, 2009
7. Further Reading Links
✤ “Modifying Forms in Drupal 5 and 6”
http://www.lullabot.com/articles/modifying-forms-5-and-6
✤ hook_form_alter() function
http://api.drupal.org/api/function/hook_form_alter/6
✤ The D6 Form API (a.k.a. FAPI) quickstart
http://api.drupal.org/api/file/developer/topics/forms_api.html/6
✤ Form API reference
http://api.drupal.org/api/file/developer/topics/
forms_api_reference.html/6
Photo On Intro Slide: Http://is.gd/17yFt
Sunday, June 28, 2009