I want to alter some data on preview page of Webform and I want to add Tpl for it .
How can I theme for Webforms preview page , and what's the Tpl for it ?


I find two solution links, please check them:

Sol-1: https://www.drupal.org/node/1430034 (Most relevant solution)

Sol-2: How to theme a webform - D7 (It another solution to theme webform with another tpl name: webform-form.tpl.php. Here is the link which provide tpl code.)

I guess you need to use node--webform.tpl.php and also add preprocessor in template.php.

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

And when you create tpl file you can check preview variable to check and theme accordingly.

If this doesn't help try second solution.

  • @Pierre.Vriens thanks for your comment. Added detailed answer with my suggested solution. – Kamran Zafar Dec 24 '16 at 17:33
  • Those links are relevant and will surely help – Kamran Zafar Dec 24 '16 at 17:39
  • Sure adding phrases. – Kamran Zafar Dec 24 '16 at 17:44
  • Edited the main answer. – Kamran Zafar Dec 24 '16 at 18:03
  • Voilà, that is a nice answer! – Pierre.Vriens Dec 24 '16 at 18:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy