Change site logo for an specific content type I'm building a really simple site and I came into this question now. The site has a few content types and one of them acts as a moderated wiki (only users with a certain role may create/edit that content). When viewing lists of these nodes or when viewing any node of that content type in full-mode I would like the site logo to be different. Say, instead of «My site», something like «My site [[wiki]]».

My first thought was tweaking context to change theme settings based on context. Too bad, I didnt find how to get that :/

I've been diving in the available answers here, but I dont seem to have an answer, though a couple of similar question tackle this subject through different systems:


One attempts to show different logo for different languages and relies and i18n and variable modules. see thread on i18n and variable
Second one adds a variable (though it is not clear if they put it directly in the node--type.tpl file (and i wouldnt like that :-/), by hand-writing the path to the desired image... see thread on tpl "abusing" :D


Any ideas on what is the best approach to get this custom logo for an specific content type?

Thanks :)

The code provided in the answer wasn't working properly, but I adapted the code and got it to work:

function YOURTHEMENAME_preprocess_page(&amp;$vars, $hook) {
  if (isset($vars['node'])) {
  // If the node type is "blog" the template suggestion will be "page--node--blog.tpl.php".
   $vars['theme_hook_suggestions'][] = 'page__node__' . str_replace('_', '--', $vars['node']-&gt;type);
   }
}


With this function I got a tweakable and customized page.tpl.php. Now I only need to change the $logo value for this content type or add extra settings to the theme, as hard-coding the url path for the alternative logo seems inelegant :)
The simplest way would be to create a tpl for the content type to do that you can follow the below steps

First create a preprocess_page function as given below. This would go into the template.php file. 

function YOURTHEMENAME_preprocess_page(&amp;$vars) {
  if (isset($vars['node']-&gt;type)) {
    $vars['theme_hook_suggestions'][] = 'page__' . $vars['node']-&gt;type;
  }
}


now you can create a new page.tpl per content type something like 

page__CONTERNTTYPENAME.tpl.php


You can copy the entire content of the existing page.tpl.php into this and replace the logo with the desired logo. 

in zen theme the logo is in the page.tpl is printed as follows

&lt;?php if ($logo): ?&gt;
      &lt;a href="&lt;?php print $front_page; ?&gt;" title="&lt;?php print t('Home'); ?&gt;" rel="home" id="logo"&gt;&lt;img src="&lt;?php print $logo; ?&gt;" alt="&lt;?php print t('Home'); ?&gt;" /&gt;&lt;/a&gt;
    &lt;?php endif; ?&gt;


here you can replace the image src with the direct path to your logo.