0
votes

I know how to override a Drupal 7 webform using webform-form-[nid].tpl.php but how do I theme ALL Drupal 7 webforms of a certain content type.

That content type ALWAYS has the same form but the nid changes with the new node id so I can't use the normal method.

Can this be done?

1

1 Answers

0
votes

You can add node type to body class.. about like this:

// Replace hook with your theme name and put this in your template.php
function hook_preprocess_html(&$vars) {
  //  Add  class to body if certain node type
  if ($node = menu_get_object()) {
    $vars['classes_array'][] = "node-type-" . $node->type;
  }
}

Then you can style your forms by node type.