Consider injecting {{ styles }}, {{ scripts }} and {{ scripts_bottom }} into #type 'html'

Created on 12 November 2014, over 10 years ago
Updated 21 April 2025, about 18 hours ago

This is a follow-up for #2352155: Remove HtmlFragment/HtmlPage .

dawehner at #2352155-74: Remove HtmlFragment/HtmlPage .2:

+++ b/core/includes/theme.inc
@@ -1710,35 +1708,27 @@ function template_preprocess_html(&$variables) {
+  $all_attached = ['#attached' => $attached];
+  drupal_process_attached($all_attached);
+
+  $variables['html']['styles'] = drupal_get_css();
+  $variables['html']['scripts'] = drupal_get_js();
+  $variables['html']['scripts_bottom'] = drupal_get_js('footer');
+  $variables['html']['head'] = drupal_get_html_head(FALSE);

Can we add a follow up here to not rely on this really implicit behaviour?

Wim Leers in #2352155-78: Remove HtmlFragment/HtmlPage :

Not sure what you want to see added here. The thing is that this already is a huge clean-up compared to HEAD. this doesn't change anything functionally relative to HEAD. So what "really implicit behavior" do you mean?

dawehner in #2352155-83: Remove HtmlFragment/HtmlPage

#2 Well ... type HTML should rather get the CSS/JS explicit as variable passed in, but sure this is so out of scope here.
It is just one thing we could do in the future.

📌 Task
Status

Postponed: needs info

Version

11.0 🔥

Component

base system

Created by

🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

Live updates comments and jobs are added and updated live.
  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States smustgrave

    Thank you for creating this issue to improve Drupal.

    We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

Production build 0.71.5 2024