Guest User

Untitled

a guest
Dec 19th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. function THEME_preprocess_entity(&$variables) {
  2. if (isset($variables['paragraphs_item']->bundle) && variables['paragraphs_item']->bundle == "XXXXX") {
  3. $variables["elements"]["#attached"]['js'][] = array(
  4. 'type' => 'file',
  5. 'data' => 'myfile.js',
  6. );
  7. }
  8. }
  9.  
  10. $variables['#attached']['js'][] = 'myfile.js';
  11.  
  12. $variables['#attached']['library'][] = 'myfile.js';
Add Comment
Please, Sign In to add comment