Chapter 7. Theming Webform

In this chapter, we will cover the following topics:

  • Preparing our custom theme
  • Adding custom CSS
  • Adding JavaScript tricks
  • Theming the confirmation page
  • Theming Webform e-mail headers

Introduction

Theming is simply about presentation, what things look like. All good interactive software designs strive towards a separation between the bits that do the heavy work and the bits that present the results to the user. This software design methodology enables the technical folks to get on with their under-the-hood work without interrupting the design folks in their bid to make the user interface look absolutely awesome.

A simple analogy to explain the concept of theming would be clothing. We can dress our bodies up to look very relaxed and casual by putting on a pair of short pants and a t-shirt or we could go to the other extreme and don a tailored business suit. Neither outfit changes the way our bodies and organs function, but they certainly do change the way we present ourselves to the world.

In this chapter, we are going to cover the ways that Webform interacts with the Drupal theme system and look at how we may manipulate the presentation of various Webform outputs. The full subject of the Drupal CMS theming system is well beyond the scope of this book, but we'll learn enough here to confidently bend aspects of Webform output to our will.

Those of us who are unfamiliar with HTML, Cascading Style Sheets (CSS), JavaScript, and PHP will benefit from gaining a basic understanding of these subjects before delving into this chapter. An excellent introductory resource to the general web-development subjects is the W3Schools website at http://www.w3schools.com/. Note that the exercises in this chapter are simple enough for most interested folks to follow and understand, so we don't need to put the book down just yet.

We will briefly discuss the intent and purpose of the various code snippets that appear in these exercises. However, the full intricacies involved will not be dealt with in great detail. This chapter is primarily aimed at developers and a certain amount of knowledge is assumed.

Obtaining full value for the theming capabilities exposed by Webform requires an understanding of the Drupal Form API (http://api.drupal.org/api/file/developer/topics/forms_api.html). General information about Drupal theming and customizing of themes is available at http://drupal.org/documentation/theme. Developers seeking an introduction to using the Drupal theme layer can start their journey at http://drupal.org/node/933976 on the drupal.org website.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset