Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By TuTToWeB on
Dear all
I am developing my own theme and this is the libraries yml file
global-styling:
version: 1.x
css:
theme:
css/bootstrap.css: {}
css/freelancer.css: {}
css/font-awesome/css/font-awesome.min.css: {}
http://fonts.googleapis.com/css?family=Montserrat:400,700: {type: external}
http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic: {type: external}
js:
js/bootstrap.js: {}
js/cbpAnimatedHeader.js: {}
js/classie.js: {}
js/freelancer.js: {}
http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js: {type:external, minified: true}
dependencies:
- core/jquery
everything here I working fine, except the jquery.easing.min external javascript. The external css are working properly, but not this js and I don't know what I should do.
Thank you in advance for your help
Comments
You probably need to add the
You probably need to add the remote, licence and other details, heres how I have done it:
I would not jam everything in one library like that either (for one you can't add the proper versions), split it up and create a dependencies chain.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Thank you for your answer,
Thank you for your answer,
I am not quite familiar with this news on drupal 8.
If I create a new YAML for this library, how can I assign the dependence on this? Basically, how should I do to get the dependencies chain as you suggested?
Like this
The the only library to load for your theme is "mytheme/freelancer"
EDIT: I noticed you were using the wrong URL for jQuery easing, cdnjs is always
https
, I fixed it in the above code - so that will be the real problem :)https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Also you should really always
Also you should really always use https for Google fonts as well, if you use http its insecure and you will get mixed content warnings if you use https on your site.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
I think now I am getting how
I think now I am getting how these library files are structured.
It worked very well.
Thanks a lot for your help
Best
Hi, I'm interested in to add
Hi, I'm interested in to add enquire.js to my theme. As I added it with npm, what kind of code do I add to my libraries.yml file ?
Thanks
Dev Server Shared Hosting
8 websites powered by drupal 6,8 & 9 - Hosted by Always Data