Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I tried to include in region--content.tpl.php the render of the $messages. But it seems not to be available.
<?php if (isset($messages)): ?>
<div id="message-container" class="container-<?php print $default_container_width; ?> clearfix">
<div class="grid-<?php print $default_container_width; ?>">
<?php print $messages; ?>
</div>
</div><!-- /.container-xx -->
<?php endif; ?>
Comments
Comment #1
fubhy CreditAttribution: fubhy commented$messages is not available in regions (its a page variable, not a region variable). For Omega we also made it a Zone variable (therefore its available in the zone templates) in order to render it on top of everything in the content ZONE (see zone--content.tpl.php). If you want to make it available for regions you would have to add $messages via hook_region_process (see /sites/all/themes/omega/omega/process/process-region.inc). However, I suggest you disable this inflexible stuff completly (I hate how Drupal core forces you to place $messages, $tabs, etc. in your .tpl Files). Instead you could use the "Delta blocks" module (its a part / submodule of the Delta module package (http://drupal.org/projects/delta) and allows you to place $messages and all of the other inflexible page variables in Blocks.
Comment #2
travis uribe CreditAttribution: travis uribe commentedFubhy, I know this is millions of years later, but I want to extend to you a thank you. As soon as I realized how irritating getting around this issue was going to be I googled it, and yours was the first and only solution I came across and it's a very good one.
Comment #3
leymannxWell @fubhy, you may hate how Drupal forces you to place $messages. Other may hate how Omega forces inconsistency on that. +1 for Delta module and placing a $messages block.
Comment #4
fubhy CreditAttribution: fubhy commentedLuckily that is no longer a problem in Drupal 8 (It's now a Block in Drupal 8 too).