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.
http://api.drupal.org/api/drupal/modules--system--page.tpl.php/6 is missing a mention of the $node variable
Source at http://api.drupal.org/api/function/template_preprocess_page/6 shows this is present when the page displays a single node.
Comment | File | Size | Author |
---|---|---|---|
#20 | 629958-20.patch | 5.42 KB | jhodgdon |
#19 | page-tpl-php-D6.patch | 5 KB | rdrh555 |
#12 | page-tpl-php-fix-D6.patch | 2.67 KB | rdrh555 |
#9 | 629958.patch | 2.2 KB | jhodgdon |
#6 | 629958.patch | 2.02 KB | jhodgdon |
Comments
Comment #1
jhodgdonGood point.
Needs fix in Drupal 7, then backport to Drupal 6.
Comment #2
jhodgdonHere's a patch for Drupal 7: adds $node, and fixes a couple of minor formatting issues (lines longer than 80 characters).
If accepted, the new $node line should be added to the D6 version too, and there are a couple of formatting issues there too.
Comment #3
NaheemSays CreditAttribution: NaheemSays commentedIs the second sentence still true in Drupal 7? Either way, it is unneeded as that is an implementation detal. $is_front can be used by other things too.
Comment #4
jhodgdonGood point, I'll take that out. It's not being used in the module/system/page.tpl.php at a minimum.
Comment #5
jhodgdonComment #6
jhodgdonHere's a new patch, with the thing about the mission statement removed, since it certainly is not reflected in this page.tpl.php file.
Comment #7
moshe weitzman CreditAttribution: moshe weitzman commentedI would prefer "If the page is a node detail page,". I added the word detail
Comment #8
joachim CreditAttribution: joachim commentedIs 'node detail page' the term we're using for what is at node/xx?
It would be handy if we had such a term, and that might be clearer than things like 'node page' (urgh!) and 'node view' (matches the UI, but confusable with Views module!). Would need to be listed as the standard terminology and docs updating to use it.
Comment #9
jhodgdonWell, it's actually not just node detail display pages. It's any page that has a menu router item using node_load() to auto-load a node, if the node ID is in the second position of the path. Because $node is included if it is returned from http://api.drupal.org/api/function/menu_get_object/7
So here's a patch which documents this. Hope it's not too confusing.
Comment #10
grendzy CreditAttribution: grendzy commentedLooks good to me.
Comment #11
webchickLooks like a good clean-up. Committed to HEAD.
Moving down to 6.x-dev for porting.
Comment #12
rdrh555 CreditAttribution: rdrh555 commentedPatch for D6
Comment #13
jhodgdonHmmm.
If you are going to fix up this doc header, it would be good to end up with it completely fixed. For instance, it should end up with all lines wrapping at 80 characters or less in the doc header (as close to 80 characters as possible), and no whitespace at the ends of lines.
Other than that, it looks good. Thanks!
Comment #14
rdrh555 CreditAttribution: rdrh555 commentedHmmm, while reviewing this, patch looks as though it deletes the $tabs and $messages (total 3) lines. I did not do that. I moved "prominently" to the next line, but that's it. Don't understand.....the lines still exist in my local copy.
Comment #15
jhodgdoncross post...
Not sure what's happening in your patch. Maybe try creating it again?
Comment #16
jhodgdonOh. Your patch is fine in that regard. It removes the lines and replaces them with different lines. $tabs is still there.
Comment #17
rdrh555 CreditAttribution: rdrh555 commentedWas writing #14 as you posted #13. I will fix completely and post a new patch.
Comment #18
jhodgdonComment #19
rdrh555 CreditAttribution: rdrh555 commentedRedone
Comment #20
jhodgdonHow about this version? Fixes up a few lingering whitespace, consistency, and standards issues.
Comment #21
rdrh555 CreditAttribution: rdrh555 commentedYes it does, thanks for the fixes. Looks great.
Comment #22
Gábor HojtsyThanks, committed.