List $node as available variable in page.tpl.php

Jennifer_M - August 12, 2009 - 09:00
Project:Zen
Version:6.x-1.0
Component:Documentation
Category:bug report
Priority:minor
Assigned:Unassigned
Status:closed
Description

Just a small point: in page.tpl.php, there's a section in the descriptive comments entitled "Available variables", followed by a long list of them.

$node is not in the list, but it is available to page.tpl.php.

How about a line something like

* - $node: The node object, if the current page is a single node, including all properties such as e.g. $node->type, $node->created.  If the page is _not_ a single node, $node is empty.

maybe under "General utility variables"? as it's not called directly in Zen's page.tpl.php.

I've put "minor" inasmuch as the lack of this doesn't actually stop anything working, but I do think it's a bug, as it misled me for a while into thinking $node wasn't available there.

h.t.h.

Jennifer

#1

JohnAlbin - November 5, 2009 - 13:55
Status:needs review» fixed

Excellent suggestion!

I used slightly different discription and put it under Page metadata, but I've created you with the fix in CHANGELOG.txt. :-)

#2

System Message - November 19, 2009 - 14:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.