Check your version

This video covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Theming forms

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:03
    Theming Forms
  • 0:06
    with Joe Shindelar
  • 0:08
    In the previous chapter,
  • 0:09
    we looked at using hook_form_alter in order to make simple changes
  • 0:12
    to forms, changing things like the label
  • 0:14
    on the user registration form.
  • 0:17
    In this chapter, we're going to take a look at some more
  • 0:19
    advanced form theming techniques.
  • 0:22
    What I'd like to do is make some changes
  • 0:24
    to the comment form on our site.

Theming Forms

Loading...

This chapter goes through the process of adding a specific form id to the theme registry with the hook_theme() function, which allows the creation of a new function that targets a specific form. Specifically in this chapter, comment_form is added to the theme registry so that we can create a ninesixtyrobots_comment_form() function in order to add a column to the comment form so that the name and subject fields are displayed side-by-side.

Additional resources: