diff --git a/includes/webform.emails.inc b/includes/webform.emails.inc index f7c4f1e..804e926 100644 --- a/includes/webform.emails.inc +++ b/includes/webform.emails.inc @@ -252,7 +252,7 @@ function webform_email_edit_form($form, $form_state, $node, $email = array()) { '#default_value' => $email['template'] == 'default' ? 'default' : 'custom', ); - $default_template = theme(array('webform_mail_' . $node->nid, 'webform_mail', 'webform_mail_message'), array('node' => $node, 'email' => $email)); + $default_template = theme(array('webform_mail__' . $node->nid, 'webform_mail', 'webform_mail_message'), array('node' => $node, 'email' => $email)); $template = $email['template'] == 'default' ? $default_template : $email['template']; $form['template']['template'] = array( '#type' => 'textarea', diff --git a/templates/webform-form.tpl.php b/templates/webform-form.tpl.php index d839083..72b4b86 100644 --- a/templates/webform-form.tpl.php +++ b/templates/webform-form.tpl.php @@ -4,10 +4,13 @@ * @file * Customize the display of a complete webform. * - * This file may be renamed "webform-form-[nid].tpl.php" to target a specific + * This file may be renamed "webform-form--[nid].tpl.php" to target a specific * webform on your site. Or you can leave it "webform-form.tpl.php" to affect * all webforms on your site. - * + * + * You can also add your own custom template suggestions to the theme_hook_suggestions + * array as you wish, which would use templates such as "webform-form--mycustompath.tpl.php" + * * Available variables: * - $form: The complete form array. * - $nid: The node ID of the Webform. diff --git a/templates/webform-mail.tpl.php b/templates/webform-mail.tpl.php index cb8f5bd..78ad5ca 100644 --- a/templates/webform-mail.tpl.php +++ b/templates/webform-mail.tpl.php @@ -4,9 +4,12 @@ * @file * Customize the e-mails sent by Webform after successful submission. * - * This file may be renamed "webform-mail-[nid].tpl.php" to target a + * This file may be renamed "webform-mail--[nid].tpl.php" to target a * specific webform e-mail on your site. Or you can leave it * "webform-mail.tpl.php" to affect all webform e-mails on your site. + * + * You can also add your own custom template suggestions to the theme_hook_suggestions + * array as you wish, which would use templates such as "webform-mail--mycustompath.tpl.php" * * Available variables: * - $node: The node object for this webform. diff --git a/webform.module b/webform.module index c5c1802..ad72360 100644 --- a/webform.module +++ b/webform.module @@ -625,7 +625,6 @@ function webform_theme() { 'webform_form' => array( 'render element' => 'form', 'template' => 'templates/webform-form', - 'pattern' => 'webform_form_[0-9]+', ), 'webform_confirmation' => array( 'variables' => array('node' => NULL, 'sid' => NULL), @@ -2922,6 +2921,7 @@ function template_preprocess_webform_form(&$vars) { elseif (isset($vars['form']['submission']['#value'])) { $vars['nid'] = $vars['form']['submission']['#value']->nid; } + $vars['theme_hook_suggestions'][] = 'webform_form__' . $vars['nid']; if (!empty($vars['form']['#node']->webform['conditionals'])) { module_load_include('inc', 'webform', 'includes/webform.conditionals');