I would like to move the $messages div for any webform type away from a div but instead add it inside the tag. I've started with THEME_preprocess_page(&$variables) in my template.php but I am stuck because the $variables doesnt set which element (or id/classes) the $messages should be placed in. Any suggestions/help would be appreciated. Thanks!


Copy your webform-form.tpl.php from the contrib webform module folder (under templates) to your themes templates folder and make the modifications there.

Default code:

if (isset($form['preview_message'])) {
  print '<div class="messages warning">';
  print drupal_render($form['preview_message']);
  print '</div>';
| improve this answer | |
  • The $messages variable cannot be access in that template... So I cant use this solution.. – gerl Jan 9 '15 at 19:56
  • Can you post a screenshot or elaborate a little more on what messages, I am kind of having a brain fart as to which you mean. – sareed Jan 9 '15 at 20:12
  • Oh, do you mean the regular page.tpl.php status messages not webform specific? If so try themeing the status messages – sareed Jan 9 '15 at 20:23

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.