You are here

function noscript_tag_page_attachments in Noscript Tag 8

Implements hook_page_attachments().

File

./noscript_tag.module, line 44
Adds functionality to display noscript tag when javascript is disabled.

Code

function noscript_tag_page_attachments(array &$attachments) {

  // If the user has view permission, Add CSS.
  if (\Drupal::currentUser()
    ->hasPermission('view noscript tag')) {

    // Add css.
    $attachments['#attached']['library'][] = 'noscript_tag/noscript_tag';
  }
}