You are here

function template_preprocess_message_banner in Message Banner 8

Implements template_preprocess_HOOK().

File

./message_banner.module, line 78
Main module file for the Message Banner module.

Code

function template_preprocess_message_banner(array &$variables) {
  $variables['attributes']['id'] = 'message-banner';
  $variables['attributes']['class'][] = 'message-banner';

  // Add the banner color as a class.
  $config = Drupal::config('message_banner.settings');
  $variables['attributes']['class'][] = $config
    ->get('banner_color');
}