Printing the drupal messages in page.tpl.php is easy:
<?php print render($messages); ?>
How can I go about doing a similar thing in my Panel layouts?
- I realise there is 'status messages' pane you can use - I wish to avoid this since admin staff will forget to include it on new pages
- I definitely wish to do it in the Panel template because there is a section above where the messages should display that is set by the admin staff
- I have tried simply putting that code into
mylayout.tpl.php, it didn't work
Here's an example of what I am trying to do:
Is there something I can do in a pre-process function to get this to work?
Thanks to @Beebee I rediscovered the template_preprocess_LAYOUT function in my layout's .inc file and added
$variables['messages'] = drupal_get_messages();
$messages exist when the template is called but they contain an array of messages rather than the usual rendered output in a string.