How to display status messages in a particualr region

Events happening in the community are now at Drupal community events on www.drupal.org.
TikaL13's picture

I am trying to display error and or status messages in a div that is a grid-8. Currently out of the box its set to grid-12 which causes other elements on the page to render wrong when messages appear.

This is what I am getting then there is an error:

<div class="grid-12" id="messages"><div class="messages error"></div></div>

I would like to set the class "grid-12" to a grid-8.

Has anyone come across needing to do this?

Comments

use delta to display the

marcoka's picture

use delta to display the messages in a block and then style that block individually?

@e-anima we tried that

banghouse's picture

@e-anima we tried that already. There is a div causing the sidebar-second to move when messages display regardless of being in a delta block. We were working on it in irc yesterday.

Thanks for the help

TikaL13's picture

Still nothing... banghouse I see where the call is being made. Omega > templates > zone--content.tpl.php thanks for that

<?php if ($messages): ?>
    <div id="messages" class="grid-<?php print $columns; ?>"><?php print $messages; ?></div>
<?php endif; ?>

The class that it's being given is whats causing problems for me. If there was a way to tell it to display in a class of grid-8 instead of grid-12

I also see this in Omega's template.php file Omega > template.php

/**
* Implements hook_process_zone().
*/
function omega_alpha_process_zone(&$vars) {
  $theme = alpha_get_theme();
 
  if ($vars['elements']['#zone'] == 'content') {
    $vars['messages'] = $theme->page['messages'];
    $vars['breadcrumb'] = $theme->page['breadcrumb'];
  }
}

Any help would be much appreciated

for anyone else looking..

tmsimont's picture

i was able to solve this by putting the messages into the content region, rather than the zone.

in my template.php folder:

<?php
/*
* Implements hook_process_zone().
*/
function THEME_alpha_process_zone(&$vars) {
 
$theme = alpha_get_theme();
  if (
$vars['elements']['#zone'] == 'content') {
   
$vars['messages'] = FALSE;
  }
}


/**
* Implements hook_process_region().
*/
function THEME_alpha_process_region(&$vars) {
  if (
$vars['elements']['#region'] == 'content') {
   
$theme = alpha_get_theme();
   
$vars['messages'] = $theme->page['messages'];
  }
}
?>

and then in my /templates directory:

region--content.tpl.php

<div<?php print $attributes; ?>>
  <div<?php print $content_attributes; ?>>
    <?php if ($messages): ?>
      <div id="messages"><?php print $messages; ?></div>
    <?php endif; ?>
    <a id="main-content"></a>
    <?php print render($title_prefix); ?>
    <?php if ($title): ?>
    <?php if ($title_hidden): ?><div class="element-invisible"><?php endif; ?>
    <h1 class="title" id="page-title"><?php print $title; ?></h1>
    <?php if ($title_hidden): ?></div><?php endif; ?>
    <?php endif; ?>
    <?php print render($title_suffix); ?>
    <?php if ($tabs && !empty($tabs['#primary'])): ?><div class="tabs clearfix"><?php print render($tabs); ?></div><?php endif; ?>
    <?php if ($action_links): ?><ul class="action-links"><?php print render($action_links); ?></ul><?php endif; ?>
    <?php print $content; ?>
    <?php if ($feed_icons): ?><div class="feed-icon clearfix"><?php print $feed_icons; ?></div><?php endif; ?>
  </div>
</div>

clear cache

Omega Framework

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week