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.
I would like to add a domain name for the location of the stylesheets and js of our website. In other words from this:
<link rel="stylesheet" href="/sites/default/files/css/css__wBfhyL83sORKzo__AgHv4HOGuOoSbIzIaa4clq9PXs.css?pclkf4" media="all" />
to this:
<link rel="stylesheet" href="//domain.name/sites/default/files/css/css__wBfhyL83sORKzo__AgHv4HOGuOoSbIzIaa4clq9PXs.css?pclkf4" media="all" />
I can see the following in html.html.twig:
* Variables:
* - $css: An array of CSS files for the current page.
...
<css-placeholder token="{{ placeholder_token|raw }}">
<js-placeholder token="{{ placeholder_token|raw }}">
I can also see the following in templete_preprocess_html: $variables["#attached"]["html_response_attachment_placeholders"]
Unfortunately, I do not know how to proceed from here. I'm using a bootstrap scss sub-theme and custom modules. I feel the implementation will be straight-forward. Please give me a push. Thanks!
Comments
Comment #2
Greg Sims CreditAttribution: Greg Sims as a volunteer commentedComment #3
markhalliwellThis isn't an issue related to this project specifically. The CSS/JS placeholders are generated dynamically and lazy loaded. Furthermore, they're run through an aggregation API that can alter and modify said list countless times.
There's not really any great documentation (that I know) of how this all works, but I'd recommend taking a look at https://www.drupal.org/project/advagg and seeing how/what they do. That might point you in the right direction.