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

fubhy’s picture

Status: Active » Closed (fixed)

$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.

travis uribe’s picture

Fubhy, 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.

leymannx’s picture

Issue summary: View changes

Well @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.

fubhy’s picture

Luckily that is no longer a problem in Drupal 8 (It's now a Block in Drupal 8 too).