You are here

function modal_page_page_attachments in Modal 8

Same name and namespace in other branches
  1. 8.3 modal_page.module \modal_page_page_attachments()
  2. 8.2 modal_page.module \modal_page_page_attachments()
  3. 5.0.x modal_page.module \modal_page_page_attachments()
  4. 4.0.x modal_page.module \modal_page_page_attachments()
  5. 4.1.x modal_page.module \modal_page_page_attachments()

Implements hook_page_attachments().

File

./modal_page.module, line 13
Main file for the Modal Page.

Code

function modal_page_page_attachments(array &$attachments) {
  $config = \Drupal::config('modal_page.settings');
  $modals = $config
    ->get('modals');
  $modals_by_parameter = $config
    ->get('modals_by_parameter');
  if (!empty($modals) || !empty($modals_by_parameter)) {
    $attachments['#attached']['library'][] = 'modal_page/modal-page';
  }
}