I want to display custom error messages below that text field in comments form. Currently it displays all error messages above the page which is not acceptable.

I'm using this theme for my blog. I also used this but it's not working. As I'm new in drupal I'm struggling with this, please suggest any solution.

  • If you are familiar with jquery, you can achieve this by using jquery also. – Suraj Sep 7 '16 at 6:18

You need go to your theme's template folder and edit page.tpl.php'

Look for <?php print $messages; ?> and move it below <?php print render($page['content']); ?>

Thanks for the note @Kevin. If you wish, you can add if statements around the <?php print $messages; ?> that check the page url and/or content type if you need to have them appear below only for certain pages.

  • Note that this is a global change, all messages from drupal_set_message() will now appear below the page content, which may or may not be acceptable. – Kevin Sep 6 '16 at 17:37

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.