Theming a Drupal 7 Webform

By shane
Sat, 2012-09-22 00:01
Daily Dose of Drupal Episode #13

Share with Others

A simple example showing how to theme a Drupal 7 webform created by the Drupal Webform module. If you need to change the structured HTML around your webform, this episode will help.

In this episode you will learn:

  • How to override the Drupal 7 Webform template file in your theme
  • How to access and display output of your Webform in the template file


I have finally got around to fixing the sound on this video.

I have tried php print snippet but it dosent work so i tried a diff code and that dosent work aswell is therw any other code that u can send could u send me another php snippet on my email please m using drupal 7 and how do i check for errors on php (i m very new to developing) do u have a video for it that shows arrays on my form

Thank for a nice tutorial!

I have tried exactly what you have shown in this tutorial. But the problem is the fields are not displaying. Do i need to enable any another essential modules except webform?

Thanks in adv.

We use Komodo Edit as our editor of choice. It has quite a bit of useful features for an editor. But it's still pretty simple to learn how to use.

is there a way to print out the submit button in order that a class can be added? Is there also a way to add classes to the fields getting rendering in the screencast?


I think the best way to do this is to implement hook_form_alter() for your specific Webform. This will allow you to access all of the form fields which will allow you to easily add classes to these fields.

Post new comment