Access Node in html.tpl.php in Drupal 7 I am trying to access the current $node variables in the html.tpl.php within Drupal 7. The problem is that I am running a Analytics software in the backend for which I've to record each page's analytics from html.tpl.php. 

If there's a normal page, I have to record generic attributes but if it's a node, I need the following things in the html.tpl.php:-


Title of the Content (Node)
Content Type of the Content


I can do this in node.tpl.php through $node-&gt;type;, but unfortunately I need it in html.tpl.php.

Many Thanks.
You can get the current menu object with menu_get_object(). From there you can determine if that object is a node or not. Since it defaults to "node" it will be empty if you're not on a node page and will have all the normal node object stuff available if you are.

$node = menu_get_object()