Syndicate

Feed

forms

May
27

Theming the contact form in Drupal 6

The following exercise consists in theming the contact form in Drupal 6. Once we're done, it will look like we'll have created two fall-back-on 'pages' for contact forms, one page/form to 'request a quote' at Randy.com/contact/quote, and an other page/form for general inquiries at Randy.com/contact/info. The trick here — if there's one — consists in theming the contact form differently based on the requested URI.

This exercise will show you how to:

  • recognize when a module has not registered a specific theming function for a form it generates,
  • register a theming function for a Drupal form in your theme, using HOOK_theme,
  • work with template suggestions,
  • use the Devel module function dsm() to inspect complex variables, such as Drupal forms.

 Read more →

May
09

Theming the node form in Drupal 6

The following exercise consists in moving pieces of code around, code that I did not write myself. Credit for the code goes to Joakim Stai (nicknamed 'ximo' on Drupal.org), the maintainer of the excellent Node form layouts module, as well as to the Usability group.

This exercise is all about gaining experience in:

  • adding theme settings to a theme configuration page
  • theming forms inside a theme, as opposed to writing a module for the same purpose
  • creating a sub theme

 Read more →

One file is attached to this posting. Login or register to download this file.


May
21

Theming the register form in Drupal 6

The following exercise consists in adding Terms of Use to the register form in Drupal 6. Provided that your website visitors aren't logged in, they can view the register form on the page myWebSite.com/user/register.

This exercise will show you how to:

  • recognize when a module has not registered a specific theming function for a form it generates,
  • register a theming function for a Drupal form in your theme, using HOOK_theme,
  • use the Devel module function dsm() to inspect complex variables, such as Drupal forms,
  • use the Theme Developer 'Themer info' widget to inspect those forms that only 'anonymous users' can see, for instance... the register form.

 Read more →

Feed