[development] node object in hook_block?
Augustin (a.k.a. Beginner)
drupal.beginner at wechange.org
Sat Jul 1 07:54:44 UTC 2006
Hello,
I see many implementations of hook_block who declare
global $user
but none with
global $node
I tried it but $node is still not set, so I cannot access the node object
directly.
the solution would be to do like in book_hook() and check on arg():
if (arg(0) == 'node' && is_numeric(arg(1)))
but it looks like a hack and for what I have in mind, it makes things more
complicated.
Isn't there a possibility to have directly access to the $node object?
How?
thanks,
Augustin.
--
http://www.wechange.org/
Because we and the world need to change.
http://www.reuniting.info/
Intimate Relationships, peace and harmony in the couple.
More information about the development
mailing list