Source: Adhoura Academy Blog

Adhoura Academy Blog Include JS or CSS Library in Drupal 8

1. Create a file module_name.libraries.yml and add the below codePlugin_name: version: 1.x js: js/JS_FILE_NAME: {} 2. Implement the below hook into your module_name.module filefunction module_name_page_attachments_alter(array &$attachments) { $attachments['#attached']['library'][] = 'module_name/plugin_name'; }3. Place your js file into module folder inside the js folder.

Read full article »
Est. Annual Revenue
$100K-5.0M
Est. Employees
25-100
CEO Avatar

CEO

Update CEO

CEO Approval Rating

- -/100