O'Reilly logo

Drupal 7 Development by Example Beginner's Guide by Kurt Madel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action — adding help text to our site contact form

We will use the dpm function from the Devel module to help us get started with the first approach, then we will utilize the core hook_form_FORM_ID_alter hook to alter the core contact form. We will be adding this code to the template.php file of our custom d7dev_theme for the purpose of demonstrating adding code in a Drupal theme versus a custom module. If we wanted to ensure that these customizations would be available across all themes, then we would want to add the code to a custom module.

  1. In Aptana Studio, open the template.php file in our custom theme at /sites/all/themes/d7dev_theme.
  2. Next, switch over to the browser with the core contact form loaded, and find the ID of the form element. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required