This combines the two modules, JS Injector and CSS Injector, into a single module for simplicity.

As described from those modules, this functions the same. This module is definitely not a replacement for full-fledged theming, but it provides site administrators with a quick and easy way of tweaking things without diving into full-fledged theme hacking.

CSS Injector

Allows administrators to inject CSS into the page output based on configurable rules. It's useful for adding simple CSS tweaks without modifying a site's official theme.

JS Injector

Allows administrators to inject JS into the page output based on configurable rules. It's useful for adding simple JS tweaks without modifying a site's official theme.

These configurations uses Drupal 8 Entity API and therefore all configurations are held in the database. This means they are exportable using features or custom module installs using yml files.

This is great for multi-site installations where each site may have a few minor differences. It is sometimes easiest to allow for single site configurations.

Note

Warning: 8.x-2.x

If upgrading from 8.x-1.x, a database update will correct any configurations that are stored in the database. any configs saved in features or in modules will require some changes to adhere to the new entity type names. Names were changed from asset_injector.css_injector to asset_injector.css and similarly for js entities. Simply change the file name should be sufficient.

Overrides

This module does currently not work well with asset overrides, be it in settings.php, from the language system or contrib modules. You can help in #2870153: Work well with overrides to fix that.

Project Information

Downloads