drupal-7drupal-webform

How to apply single theme to all webform in drupal 7


I want to create a theme or page layout which will be applied to all the existing and newly created webforms. I want to divide page in 2 parts. In left part want to show webform description and in right part all the webform components.


Solution

  • You can add your custom template by using the preprocess hook:

    function themeName_preprocess_page(&$vars, $hook) {
      if (isset($vars['node'])) {
        $vars['theme_hook_suggestions'][] = 'node__'. $vars['node']->type;
      }
    }
    

    And clear your cache, and create template "node--node-type.tpl.php".

    If you want to customise form then please follow the below link

    https://www.drupal.org/docs/7/theming/howto/theming-web-form