4 Jul
2006
4 Jul
'06
3:54 p.m.
Wouldn't it be better to also return arg(1), making it a mixed return value? The node id (evaluates to true) on sucess, FALSE on failure. Since it already does the check, it is just logical to return the nid. Goba On Mon, 3 Jul 2006, [iso-8859-1] Bèr Kessels wrote:
This is the current way of doing that. And since that specific line is repeated all over Drupal and its contribs, I just added it to helpers.module:
/** * Find out if the current page is a node page. * @return TRUE if the page is a node, FALSE if it is another page. */ function is_node_page() { if (arg(0) == 'node' && is_numeric(arg(1))) { return TRUE; } return FALSE; }
Bèr