Loading of assets via Libraries API

Solutions

hook_libraries_info is not in core, it is from a contrib module:

Libraries API

This module provides the external libraries. It will be ported to drupal 8 and can be used the same way as in drupal 7.

In drupal 8 the libraries, that are defined in *.libraries.yml are seperate and should not be confused with the external libraries, despite their identical name. They are mainly for js and css packages, that are specific to one module, but can also be used by other modules. They can be a replacement for the external libraries, but do not provide the full functionality.

In the long run composer will probably be the way module developers will go for downloading external libraries. But for now this is an ongoing discussion how this can be implemented.

Your reference to https://www.drupal.org/node/1996238 is a seperate issue about the replacement of hook_library_info() in drupal 8 core. This must not be confused with the external libraries defined in hook_libraries_info().

Tags: Drupal 8 / Theming

Similar questions

Javascript libraries not loading from block class
I am working on porting module to drupal 8. My block code is as follow public function build() { $delta= $this->getDerivativeId(); $num = str_replace('dexp_layerslider_block_', '', $delta); $sid = $this->configuration['dexp_layerslider_block_slide_'.$num]; $block_id = $this->getDerivativeId(); $slideshow = dexp_layerslider_load($sid); if (!$slidesh...
Loading a custom library after all other libraries got loaded
So i wan't to load a custom .js file at the very end of the page after all other .js files have been loaded. This is my library file: So the lib is loaded in the page footer with all the rest of the .js files, but it's not last, it's somewhere in the middle. I even tried to add the dependency for toolbar.escapeAdmin as it's javascript file is loade...
Adding assets (css/js) for a custom module block (and withstanding a cache enabled install)
I've created my own block which calls a hook_theme implementation which then prepares some data and then renders myblock.tpl.php All of the above is working fine but my module does have some required assets, specifically some css & js files, currently I was doing drupal_add_css/js in my hook_block($delta = 'view') but I've discovered that both ...
Is there any way to force https:// to be used for assets and still be able to define a theme CSS files in its .info file?
I have a theme which defines its CSS files in its .info file, for example with a line like the following. The site is accessed using https://, but for some reason, Drupal tries to load all the files via http://. Is there any way to force Drupal to use https:// on assets and still be able to define a theme CSS files in its .info file?
Create drupal content programmatically with custom entity ( assets )
I am using asset module : https://www.drupal.org/project/asset I creates a new entity type = asset. I get a form where I can add ( document, image, video..). How can I, from a custom module add a content of asset ? I think that I cannot do it the way we creat nodes ... like : Please help thank you
How can I use webform to upload assets and create a project that can be assigned to different users
I am trying to put together a creative request form that a client would fill out. A studio manager would then follow up and assign to a project manager. I am using webform and rules as a starting point with the possibility of using Open Atrium.

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.