Drupal Module - Asset Injector

Drupal Module - Asset Injector

While working with Drupal (10), you would want to inject/add some of your own CSS/JavaScript without modifying the actual theme CSS.

The Module Asset Injector allows you to do the same with some added options of like where to inject, what pages to inject etc.  If you are familiar with the Block placement options you will really find this interesting.

The module "Works with Drupal: ^9.3 || ^10"  as mentioned on the modules project page.

Add the module as usual and enable it.

The module setting are available under: "Home > Administration > Configuration >  Development  > Asset Injector"

Here you can either create a CSS section or JavaScript snippet.  as set it where it is to be used. As mentioned before you can set where the code is to be used or injected.

e.g if you want your CSS to be used on front page set the location i.e show on pages to <front>

Reload your home page to see it working.

Main category

Add new comment

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
12 + 8 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

"Natraj"  Bungalow,
Colony No.7,  Sr.No. 38.
(Lane Behind Sai Baba Mandir)
Kale Borate Nagar, Hadapsar,
Pune - 411028.
Get Directions