![Motorcycly with fully packed trailer](https://blog.frobieter.de/wp-content/uploads/2022/10/drupal_extend_module_libraries_pixabay_transport-g045b11d9b_1920.jpg)
In Drupal Themes its very easy to extend existing libraries using the themes .info (and .libraries) file. This ain’t possible in a Mobule .info file. So we need a hook to do this:
/** * Implements hook_library_info_alter() * - Extend some module libraries we support or require for MY_MODULE */ function MY_MODULE_library_info_alter(&$libraries, $extension) { if ($extension == 'views_bulk_operations' && isset($libraries['frontUi'])) { // Extend existing library views_bulk_operations/adminUi // Important! That a library is listed by this hook, doesn't mean the library is attached, it just means its registered. $libraries['frontUi']['dependencies'][] = 'MY_MODULE/MY_LIBRARY_NAME'; } }
Schreibe einen Kommentar