Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
documentation
Priority:
Normal
Category:
Feature request
Assigned:
Issue tags:
Reporter:
Created:
18 Nov 2011 at 23:27 UTC
Updated:
4 Jan 2014 at 01:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
droplet commentedcopy html.tpl.php under system module to your theme
Comment #2
aaronmchaleYes, hmm, I never noticed that file probably because none of the core themes contain that file.
Would that then suggest that the core themes should contain this file?
AaronMcHale
Comment #3
droplet commentedCore don't duplicate same file into theme
Comment #4
aaronmchaleWell, there needs to be some hint there.
AaronMcHale
Comment #5
Everett Zufelt commentedYou are right, templates aren't super easy to discover. But, they are meant for developers / themers, not ed users.
A quick Google search found me http://drupal.org/node/190815
Comment #6
aaronmchaleYeah, that document is quite useful.
Here is an idea, adding a comment to the top of the page.tpl.php file for core themes explaining that there is a html.tpl.php file for customising the , , and tags.
AaronMcHale
Comment #7
Everett Zufelt commentedI don't really think this is necessary, but it is worth discussion.
Feature request to add a comment to the top of the page.tpl.php file for core themes explaining that there is a html.tpl.php file for customizing the
<html>, <head>, and <body>tags.Comment #8
aaronmchaleCool, I would write a small patch, however I'm not sure how to write patches.
AaronMcHale
Comment #9
Everett Zufelt commented@AaronMcHale
Well, the first step is for more people to weigh in on whether this is a good idea or not.
Comment #10
webchickI think it's a good idea. It's definitely not super intuitive.
Probably just involves adding another @see directive at the bottom of the docblock, since that's both the standard way to refer to things, and also just above the spot where you'd be going "Wait. Div? What the heck?"
This should both be fairly simple to do and should be backportable to D7. Tagging.
Aaron: See http://drupal.org/patch for info on how to write patches. Feel free to stop by #drupal-contribute anytime as well if you need more "real-time" help. :)
Comment #11
aaronmchaleSounds good.
Thanks for the link :)
AaronMcHale
Comment #12
droplet commenteddon't miss region.tpl :)
Comment #13
mallezieadded @see at end of docblock to html.tpl.php in page.tpl.php and small comment
added @see in region.tpl.php
i'm not sure if this is exactly what's needed. But gave it a try.
Comment #14
sven.lauer commentedThe patch also adds
This should be removed.
Also, I am not sure that region.tpl.php really needs a reference to html.tpl.php---The name page.tpl.php can be misleading in that it may suggest that the whole (HTML) page is rendered by this template.
Comment #15
mallezieRerolled with only @see addition in page.tpl.php
I'm also not sure if region.tpl.php needs an @see, but implemented droplet's suggestion.
Comment #16
droplet commented@mallezie,
Thanks for your works. I was thought region.tpl.php included in page.tpl.php
(or documented to see modules/system folder)
I think commented on system/page.tpl.php is meaningless. The real problem is when you are on bartik/page.tpl.php or any themes' files, you can't found the place to modify HEADER HTML. If we're at system folder, I guess you must open html.tpl.php and see what that is.
If it allowed, I would suggest move /core/modules/system theme templates to /theme/core/**. Or add an empty folder with README refering themer to system folder.
Comment #17
joachim commented> The real problem is when you are on bartik/page.tpl.php or any themes' files, you can't found the place to modify HEADER HTML.
Good point. Let's make this change in all of the core themes' page.tpl.php.
Comment #17.0
joachim commentedUpdated issue summary.
Comment #18
rootworkWorking on this at the Drupalcon code sprint.
Comment #19
rootworkWell, it turned out Bartik was the only one that I could add this to.
So this patch just updates page.tpl.php in the system module (as before) and the Bartik theme.
Comment #20
rootworkOops. Fixing status.
Comment #21
jhodgdonSeven theme files having no documentation - not intentional, not good, but let's not deal with it on this issue.
So... I'm wondering if this reference between page.tpl.php and html.tpl.php should be a bit more verbose than just saying "@see html.tpl.php"? Maybe something like a line saying
Note that the html.tpl.php file contains the HTML header.
or something to that effect? Which would need to go farther up in the file. Would that be clearer and easier to notice?
Comment #22
rootworkI think that would make a lot of sense.
Comment #23
jhodgdonIn that case... (status)
Comment #24
rootworkSo it turns out, after all that, at the top of Bartik's page.tpl.php file, it says:
With the new @see at the bottom (where, as webchick mentioned in #10, people might be looking) and that comment at the top, that seems sufficient, unless we really feel like we should move that comment from the top to the bottom. (My thinking is that people might skip over it, visually intuiting that it's part of the "Available variables" section which takes up most of the documentation.)
So, this rerolled patch:
Comment #25
jhodgdonAha! I don't think either of them should refer to "folder", since I think we normally use the term "directory", but I think this solution is good -- text at the top where it belongs, and @see at the bottom where it belongs.
Comment #26
rootworkCool. Changed "folder" to "directory."
Comment #27
jhodgdonLooks good to me. Tentatively setting to RTBC; if no objections I'll get it committed soon. Thanks!
Comment #28
Tor Arne Thune commentedLooks good to me. Good thinking on adding this comment in page.tpl.php. I remember I was searching for the template containing head long ago, not having found it in page.tpl.php.
Comment #29
jhodgdonCommitted to 8.x. Needs slight rework for 7.x, since the directories there do not have core/ on them.
Comment #30
kgoel commentedComment #31
kgoel commentedSorry, didn't realize it was assigned to rootwork.
Comment #32
kgoel commentedAssigning back to myself for backport.
Comment #33
kgoel commentedsimple D7 patch.
Comment #34
kgoel commentedComment #35
rootworkIf this is a D7 patch, then this comment -- while accurate in D8 -- should read (as it did before) "modules/system" and not "core/modules/system," as noted in #29.
Comment #36
kgoel commented@rootwork - good catch. Updated D7 patch.
Comment #37
rootworkLooks good to me! Others can review if they want, but it's a pretty simple patch...
Thanks kgoel!
Comment #38
jhodgdonCommitted to 7.x. Thanks!
Comment #39.0
(not verified) commentedCorrected typo.