The variable $node is not available in pagelayout.tpl and related templates once a page is cached, so if you really need it, fetch the node at the beginning of pagelayout.tpl or page_head.tpl. Check e.g here: http://ez.no/community/forum/install_configuration/no_more_node_variable_in_pagelayout (although this is for EZ 3.9, where $node apparently is not there even for the first page load, the solution is the same).