Content type aware in sidebar template I've added some image and link content to region-sidebar.tpl.php before it executes the print $content. All good, except now the client wants the images and links specific to content type. (I can't do it all in CSS, otherwise i'd go that route).

How can I test for content type in region-sidebar.tpl.php or have a variable that is set. The region-sidebar.tpl.php doesn't see a variable defined in preprocess_node. 

In region-sidebar.tpl.php I need something like:

&lt;?php if ($content): 
  if ($mycontent_type == "foo") {
       ?&gt; &lt; add some html stuff here&gt; &lt;?php
  } 
  print $content; ?&gt;
You can get the current node like this:

if ($node = menu_get_object()) {
  if ($node-&gt;type == 'foo') {
    ...
  }


But don't put that logic directly in a template file - move it out to a preprocess function instead.