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.
API page: https://api.drupal.org/api/drupal/core%21includes%21theme.inc/function/t...
I suppose the wrong path to the default location of page.html.twig is given. Actual documentation says:
Most themes use their own copy of page.html.twig. The default is located inside "modules/system/page.html.twig". Look in there for the full list of variables.
But actually it is found under: core/modules/system/templates/page.html.twig
Comment | File | Size | Author |
---|---|---|---|
#32 | interdiff-2621422-20-24.txt | 980 bytes | aditya_anurag |
#26 | 2621422-24.patch | 634 bytes | aditya_anurag |
#24 | theme-wrong-default-path-2621422-21.patch | 634 bytes | harsha012 |
#20 | theme-wrong-default-path-2621422-20.patch | 630 bytes | harsha012 |
#11 | 2621422-11.patch | 651 bytes | rakesh.gectcr |
|
Comments
Comment #2
joyceg CreditAttribution: joyceg commentedComment #3
joyceg CreditAttribution: joyceg commentedUploading the patch.
Comment #4
joyceg CreditAttribution: joyceg commentedComment #5
star-szrThis is tricky now because we have stable and classy base themes. So the default is either in the stable theme if you have no
base theme
in your theme's .info.yml, or classy. I would lean towards stable as the "default" page template.Thanks!
Comment #6
stefan.kornOk, then it should be like this
Comment #7
stefan.kornComment #8
star-szrThanks!
This should be re-wrapped to fit within 80 characters per https://www.drupal.org/node/1354#drupal.
@stefan.korn just want to mention since this is assigned it's good to give the person assigned a day or two to work on it before jumping in.
Comment #9
stefan.kornReformatting patch, respecting Drupal API documentation standards (general).
Comment #10
jhodgdonWhy are we putting this path in quotes? I think we should take out the quotes.
And anyway... this whole paragraph is kind of crazy. We don't have references like this in any other template_preprocess function that I am aware of, and a lot of themes have a lot of custom templates... Why are we saying this here? We should really just take out this whole paragraph, or just say "See the page.html.twig template for list of variables." and we don't need to be specific about saying which one is the "default". They all have lists of the variables in them.
Comment #11
rakesh.gectcr@jhodgdon
I have done according to your comment.
@stefan.korn
Apologize After creating patch only, I saw it was assigned to you.
Comment #13
stefan.korn@jhodgdon: Regarding quotes, I just took it over as it was. IMHO quotes are ok here, because they outline the path in some way. But of course this is only my personal "feeling" and if it is against standards or otherwise hindering it can and should be changed.
You are surely right that this kind of description with path is not there in every template_preprocess function, but in https://api.drupal.org/api/drupal/core!modules!node!node.module/function... it is the same. And from my point of view this information for the default path is not useless. I came across this when I was checking a problem with page.html.twig in a theme I was using. It seemed there was something wrong in the page.html.twig of this theme and then I was going to look in the default page.html.twig to spot any differences. And I found that the theme I was using had used some older elements (variables) of page.html.twig which got removed from template_preprocess_page somewhere along the way. But anyway I could also go with removing the path, because the search for page.html.twig delivers the necessary informations too.
@Cottser: You stated that the default is now in stable theme. If I go https://api.drupal.org/api/drupal/8/search/page.html.twig then "Default theme implementation to display a single page." is still "core/modules/system/templates/page.html.twig". Just wanted to point this out, because this seems a little inconsistent to me.
@All: I think patch #8 and #11 (while I am not sure why it failed testing) now offer the possibilty to fix it either this or that way, so I am leaving that decision to the experienced folks out there.
Comment #14
stefan.kornComment #15
jhodgdonI really think that if we put the reference in here, it should go to system module and not the stable theme.
I also really think that we should not put the long explanation in there at all. The header already says it is the preprocessing for page.html.twig, and for *most* preprocessing functions, that is enough.
But I will leave it to Cottser to decide.
Comment #16
jhodgdonAnyway, definitely no quotes!
Comment #17
star-szrSince Stable is the default base theme (you get this by just creating a new theme with an .info.yml and not specifying a base theme) I think it would make sense to say it's the default.
However the latest patch looks reasonable to me (I agree with @jhodgdon we probably don't need a full path) other than being a bit terse, it could use the word "a" added in there :)
Maybe "See the page.html.twig template for a list of variables."
Comment #18
jhodgdonhow about "the list of variables" not "a"?
Comment #19
star-szrYup sounds good :)
Comment #20
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedReload the patch with documentation
Comment #21
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedComment #22
star-szrThanks @harsha012. I think this should say "…for the list of variables." as was discussed in the recent comments :)
Comment #23
aditya_anurag CreditAttribution: aditya_anurag as a volunteer and at Valuebound commentedComment #24
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedadded patch as per the comment
Comment #25
aditya_anurag CreditAttribution: aditya_anurag as a volunteer and at Valuebound commentedComment #26
aditya_anurag CreditAttribution: aditya_anurag as a volunteer and at Valuebound commentedComment #27
swarad07Comment #28
aditya_anurag CreditAttribution: aditya_anurag as a volunteer and at Valuebound commentedComment #29
swarad07The patch looks good, lets wait for tests to finish. Although I don't think there is a reason they will fail. ;-) We can mark it RTBC after that.
Thanks.
Comment #30
star-szrCan someone please provide an interdiff? :)
Yes it's a small patch but practice practice practice!
Comment #31
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedComment #32
aditya_anurag CreditAttribution: aditya_anurag as a volunteer and at Valuebound commented@harsha012,
I was working on this.
Added interdiff.
Comment #33
jhodgdonThanks!
Comment #36
star-szrCommitted and pushed poolside 82296bf to 8.1.x and cc369fb to 8.0.x. Thanks!