Skip to content

Instantly share code, notes, and snippets.

@tobyontour
Created December 17, 2015 16:03
Show Gist options
  • Select an option

  • Save tobyontour/ca3bfb02d283b33ec07e to your computer and use it in GitHub Desktop.

Select an option

Save tobyontour/ca3bfb02d283b33ec07e to your computer and use it in GitHub Desktop.
Add a special template for an individual page of a multipage webform
function THEME_preprocess_webform_form(&$vars) {
/*
Add a special template for an individual page of a webform.
e.g. for the first page of a webform with a node id of 12: webform-form-12-0.tpl.php
*/
$vars['theme_hook_suggestions'][] = $vars['theme_hook_suggestion'];
$vars['theme_hook_suggestions'][] = 'webform_form_' . $vars['nid'] . '_' . $vars['form']['progressbar']['#page_num'];
// The theme_hook_suggestion would override all suggestions so unset it.
unset($vars['theme_hook_suggestion']);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment