Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function THEME_preprocess_entity(&$variables) {
- if (isset($variables['paragraphs_item']->bundle) && variables['paragraphs_item']->bundle == "XXXXX") {
- $variables["elements"]["#attached"]['js'][] = array(
- 'type' => 'file',
- 'data' => 'myfile.js',
- );
- }
- }
- $variables['#attached']['js'][] = 'myfile.js';
- $variables['#attached']['library'][] = 'myfile.js';
Add Comment
Please, Sign In to add comment