menu get object doesn't seem to work I'm a trying to pass a var, in this case the var "$node" to the page.tpl.php.
Tried everything for three days but i cannot make it work despite my code is correct apparently. Tried different ways but when i tried to check with isset if the var exists, it returns false. I really need it, so i can check pages and nodes.

This is my code:

template.tpl.php

  function agn_preprocess_page(&amp;$vars) {
  $node = menu_get_object();
  if ($node = menu_get_object()) {
      $vars['node'] = $node-&gt;type;
  }
  }


page.tpl.php

&lt;?php if (isset($node)){
   print "true";
}else{
   print "false";
}
?&gt;


Thanks in advance!
$node is already available in page.tpl.php on node pages without you having to do anything. See the documentation