Print $Messages in node.tpl.php file In Drupal 7, by default the $messages variable is printed in page.tpl.php.

Is there a way to print $messages in a node.tpl.php file (e.g. $node-mycontenttype.tpl.php).

Just putting &lt;?php print $messages; ?&gt; or
&lt;?php print render($page['messages']); ?&gt; does not work.

There's a tutorial here for printing $messages in a block, but I would like to put it in my node.tpl.php file.
Actually, what you want to do is this:

function YOURTHEME_preprocess_page(&amp;$variables) {
  // This disables message-printing on ALL page displays
  $variables['show_messages'] = FALSE;
}

function YOURTHEME_preprocess_node(&amp;$variables) {
  $variables['messages'] = theme('status_messages');
}


How this works:
Drupal core checks the value of show_messages in theme_process_page. If it is TRUE (default) then it calls theme('status_messages') as above, and effectively empties the messages storage, so calling the same theme function later will just return an empty string. However, if we set that variable to FALSE, this prevents said theme function from being called in process_page, allowing us to get all the messages using the same theme function, in a template of our choosing.