How to do a Library Override in my theme for dialog.ajax.js
-
02-03-2021 - |
Question
I’m trying to do a libraries-override to the dialog.ajax.js file appearing in /core/misc/dialog/. (Want to replace it with a js file from my theme, let's say at mytheme/js/dialog.ajax.js)
In my theme’s *info.yml file, I tried
libraries-override:
drupal.dialog.ajax:
js:
assets/js/dialog.ajax.js: false
as another post suggested (just to try and disable it). Didn't work.
My confusion comes from not knowing how to correctly target the /core/misc/dialog/dialog.ajax.js file within my override, and then correctly target my mytheme/js/dialog.ajax.js as a replacement.
I reviewed the documentation, but it's still quite unclear. Any tips? Thanks!
Solution
Looks like you're just missing the core/
prefix:
libraries-override:
core/drupal.dialog.ajax:
js:
assets/js/dialog.ajax.js: false
Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange