Can node_url be accessed in page.tpl.php? Calling debug($node) in page.tpl.php seems to show that the node object is not fully populated at this stage.

I would like to access node_url in my page template so that I can add certain CSS classes for some nodes without having to use the nid.  Is there maybe a way to access a more fully populated node object in template_preprocess_page()?
You could use the drupal_get_path_alias() function along with the node's nid to get the URL alias of the node without having to load the object:

$url = drupal_get_path_alias("node/$node-&gt;nid");


If you want the fully loaded node object though use node_load():

$node = node_load($node-&gt;nid);


Memory fails me as to whether node_url is added to the node object in a hook_node_load() implementation or as part of a theme preprocess so I'm not 100% sure it's implicitly available after you call node_load()...if it's not just use the first example which will work.

UPDATE

On inspecting the node module the node_url member comes from template_preprocess_node so while node_load() will give you the fully loaded node, I don't think it's going to be useful in this case.

In fact looking at node.tpl.php and template_preprocess_node, node_url isn't added to the node object at any point so you wouldn't normally access it with $node-&gt;node_url but instead $node_url. That variable is available by default in node.tpl.php but not page.tpl.php so you'll have to get it another way (i.e. first example above).