Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
/**
* Implements hook_page_attachments().
*/
function status_message_page_attachments(array &$attachments) {
$config = \Drupal::config('status_message.settings');
$attachments['#attached']['library'][] = 'status_message/modal_window';
$attachments['#attached']['drupalSettings']['statusMessage']['modalWindow']['width'] = $config->get('width');
$attachments['#attached']['drupalSettings']['statusMessage']['modalWindow']['height'] = $config->get('height');
$attachments['#attached']['drupalSettings']['statusMessage']['modalWindow']['background'] = $config->get('background');
}
/**
* Implements hook_theme_registry_alter().
*/
function status_message_theme_registry_alter(&$theme_registry) {
$theme_registry['status_messages']['theme paths'] = array(0 => drupal_get_path('module', 'status_message') . '/templates');
$theme_registry['status_messages']['theme path'] = drupal_get_path('module', 'status_message') . '/templates';
$theme_registry['status_messages']['path'] = drupal_get_path('module', 'status_message') . '/templates';
// tell the theme system to use 'status_message.html.twig' as the template file. Note that you do not include 'html.twig'
$theme_registry['status_messages']['template'] = 'status_message';
// for check big message dpm($theme_registry)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment