I have started putting the following code in my subthemes which causes messages to show up in a reveal box when the page loads.

Any objection to committing it to either STARTER or template.php of the theme as zurb_foundation_status_messages() ?

 
function STARTER_status_messages($variables) {
  $display = $variables['display'];
  $output = '';

  $status_heading = array(
    'status' => t('Status message'),
    'error' => t('Error message'),
    'warning' => t('Warning message'),
  ); 
  foreach (drupal_get_messages($display) as $type => $messages) {
    $output .= "<div class="messages $type">\n";
    if (!empty($status_heading[$type])) {
      $output .= '<h2 class="element-invisible">' . $status_heading[$type] . "</h2>\n";
    }  
    if (count($messages) > 1) {
      $output .= " <ul>\n";
      foreach ($messages as $message) {
        $output .= '  <li>' . $message . "</li>\n";
      }  
      $output .= " </ul>\n";
    }  
    else {
      $output .= $messages[0];
    }  
    $output .= "</div>\n";
  }
  if ($output != '') {
    drupal_add_js("jQuery(document).ready(function() { jQuery('#status-messages').reveal();
            });", array('type' => 'inline', 'scope' => 'footer'));
    $output = '<div id="status-messages" class="reveal-modal expand" >'. $output;
    $output .= '<a class="close-reveal-modal">&#215;</a>';
    $output .= "</div>\n";
  }
  return $output;
}

Comments

ishmael-sanchez’s picture

Version:» 7.x-1.x-dev
Assigned:Unassigned» ishmael-sanchez
ishmael-sanchez’s picture

Status:Needs review» Fixed

This has been added to the starter theme template.php so themers can uncomment to use or leave to keep standard messages. See http://drupalcode.org/project/zurb-foundation.git/commit/c0c6c6b.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

chrisjlee’s picture

@ishmael-sanchez
After our discussion with the navbar. I thought it might be helpful if the status messages would integrate with zurb-foundation.

I went ahead and committed the changes:
http://drupalcode.org/project/zurb-foundation.git/blobdiff/0ab7c1bc6b692...

What are your thoughts? If you want to go forward with this i can also remove the code from the starterkit.