I am having troubles trying to disable some of the CERN Components’ libraries.
For example, there is this JS file that loads that dynamically moves the edit tabs, by assigning them a hardcoded top
position. I want to disable that particular file.
I saw that the file is loaded through the cern_components
module, which in turn contains a header_blocks
pattern, which defines the carousel-library
in its header-blocks.ui_patterns.yml
file, like this:
libraries:
- cern_components/owlcarousel
- carousel-library:
js:
js/header_carousel.js: {}
css:
component:
css/header_blocks.css: {}
dependencies:
- core/jquery
- core/drupalSettings
Since my theme can handle that and I don’t need this JS file, I am trying to disable, in my theme.info.yml
file, like this:
libraries-override:
cern_components/owlcarousel: false
carousel-library: false
Well, this doesn’t work, and neither the more sophisticated version:
libraries-override:
carousel-library:
js:
js/header_carousel.js: false
I also tried supplying the full path to the file, to no avail.
I followed all the official Drupal 8 documentation regarding overriding libraries (https://drupal.stackexchange.com/questions/200418/override-a-single-javascript-file-from-a-module / https://www.drupal.org/node/2216195#override-extend / https://atendesigngroup.com/blog/mastering-drupal-8’s-libraries-api), but I can’t figure out which is the magic formula to do this…
I guess the problem resides in the internal path that this library is assigned, which I need to figure out on my own, because I can’t use any good debug tool (this makes for another topic )
Anyone has an idea on how to do this? Thanks in advance!