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.
Follow-up to #2372581: Rename 'page' render element to 'body', page.html.twig to body.html.twig
Problem/Motivation
The 'scripts_bottom' variable conditionally is populated in \Drupal\Core\Render\HtmlResponseAttachmentsProcessor::processAssetLibraries()
and used in every html.html.twig
template without any documentation.
Proposed resolution
document
Remaining tasks
review, commit.
User interface changes
None.
API changes
no
Beta phase evaluation
Issue category | Bug because documentation missing |
---|---|
Issue priority | Normal because changes only docs |
Unfrozen changes | Unfrozen because it only changes documentation of template variable |
Disruption | No |
Comment | File | Size | Author |
---|---|---|---|
#34 | interdiff-30-34.txt | 1.78 KB | sdstyles |
#34 | 2542392-34.patch | 1.82 KB | sdstyles |
#30 | 2542392-30.patch | 836 bytes | prabhurajn654 |
#25 | 2542392-25.patch | 1.84 KB | gtrost |
#25 | interdiff-2542392-21-25.txt | 1.89 KB | gtrost |
Comments
Comment #1
andypostComment #2
jhodgdonThanks for the issue and patch!
I think it needs a bit of work though...
typo: clising -> closing
Also I think you want a "the" in here somewhere, and... take out one?
So this should be:
Script tags necessary to load JavaScript files before the closing BODY tag.
But really maybe BODY should not be all caps because it isn't HEAD in the rest of the docs here?
Comment #3
andypostThanx, fixed. "HEAD" uses this caps in "head" element description
Patch also fixes "the"
Comment #5
andypostfixed patch
Comment #6
jhodgdonSo technically an element is
<tag>stuff</tag>
.So there is no closing body *element*, there is a closing body *tag*.
Right?
Comment #7
andypostsure, sorry, there's really difference (suppose element as a whole, tag as a part of template)
Comment #8
jhodgdonLooks good to me now, thanks!
Regarding tags vs. elements...
https://en.wikipedia.org/wiki/HTML_element
http://www.456bereastreet.com/archive/200508/html_tags_vs_elements_vs_at...
Comment #9
Wim Leerss/BODY/
<body>
/Comment #10
jhodgdonSorry, putting HTML inside of PHP docs is problematic. I think this should stay as it is.
Comment #11
andypostThe primary reason for me to use caps is easy to grep in core
Comment #12
webchickSounds like this still needs discussion.
Comment #13
jhodgdonIt sounds like the theming team should figure out how to refer to HTML tags in template docs, and decide how this should be done.
Putting the HTML tag like
<body>
directly into the PHP docs is not an option. It could be embedded in @code ... @endcode but that is normally for code blocks.Comment #14
joelpittetregex find
\* .*<
in*.html.twig
files for reference. It seems I'd be in favour of putting in<body>
Pingging Cottser to help here.
Comment #15
davidhernandezLooking through core, I don't see a lot of consistency in how this is treated, in comments at least. I see cases of
<tag>
andTAG
andtag
. This isn't just with html tags, but also with how protocols are written, for example. But for tags it seems to most often be<tag>
in comments.Looking for some template examples, we seem to have
<tag>
already in the templates.https://api.drupal.org/api/drupal/core!modules!system!templates!table.ht...
I assume the api site escapes them. Where does this cause a problem?
Comment #16
jhodgdonHah! Maybe the API module does escape them. It looks like it... so let's be consistent.
Comment #17
andypostFiled follow-up to discuss #2546248: Use consistent style to mention HTML tags in code comments
Here's a another way
Comment #18
davidhernandezWouldn't it be better than to use
<head>
here, or if not, then "in head" instead of "in the head"?Also, with the reworking, "in" can now move to the previous line.
Comment #19
gtrost CreditAttribution: gtrost at Skilld commentedFixed patch using
<head>
and moving "in" to previous line.Comment #20
andyposttrailing whitespace
Comment #21
gtrost CreditAttribution: gtrost at Skilld commentedFixed trailing white space.
Comment #22
andypostLooks good now
Comment #23
joelpittetThank you for the doc clean up.
Comment #24
Wim LeersThis looks like an excellent improvement :)
However, shouldn't we then be completely consistent?
s/Style tags/HTML/
s/Script tags/HTML/
(I propose not to say
<style>
, because most of the time we actually use<link rel="stylesheet">
. That's unnecessarily detailed information for these docs. Hence just saying "HTML" is sufficient AFAICT.)Comment #25
gtrost CreditAttribution: gtrost at Skilld commentedUpdated strings.
Comment #26
gtrost CreditAttribution: gtrost at Skilld commentedComment #27
joelpittetThanks @Wim Leers and @gtrost. One small nit to finish this, I think:
This doesn't need to wrap to the next line anymore.
This doesn't need to change, widows like company.
Comment #28
star-szrSorry, been otherwise occupied. I can't review all the discussion right now but around where @joelpittet assigned me I agree with those things -
<body>
is better than BODY to me as well :)Comment #29
prabhurajn654 CreditAttribution: prabhurajn654 commentedComment #30
prabhurajn654 CreditAttribution: prabhurajn654 commented@joelpittet I have made the changes as suggested in #27. please verify.
2542392-30.patch
Comment #31
prabhurajn654 CreditAttribution: prabhurajn654 commentedComment #32
prabhurajn654 CreditAttribution: prabhurajn654 commentedComment #33
joelpittetYou are missing the second template. Also please provide an interdiff with your patch. If you haven't made one before heres the docs: @see https://www.drupal.org/documentation/git/interdiff
Also it looks like the wording changed for the styles, it should have been only a line break change between #25 and yours. One line break removal for each template.
Comment #34
sdstyles CreditAttribution: sdstyles at FFW commentedComment #35
Wim LeersComment #36
alexpottCommitted 5fcb2db and pushed to 8.0.x. Thanks!
Comment #39
prabhurajn654 CreditAttribution: prabhurajn654 as a volunteer and at Srijan | A Material+ Company commented