Hi,

I am using this snip Stefan Lehmann gave me here to have a different image based on node, problem is it works fine with the id, but a couple of the nodes are views, and one is contact, how do I declare those?

<?php 
$node = menu_get_object();
$menu_image = 'arrow_home.png';
if (!empty($node)) {
  $images = array(2 => 'arrow_home.png', 3 => 'arrow_formazione.png', 4 => 'arrow_workshop.png', 5 => 'arrow_raccontabito.png');
  $menu_image = isset($images[$node->nid]) ? $images[$node->nid] : $menu_image;
}
?>
<div class="fz-menu-bg">
<img src="/sites/all/themes/business/images/fz/<?php print $menu_image; ?>" />	
</div>

Thank you

Comments

VM’s picture

Questions regarding code are better served in the 'module development and code questions'. please edit the opening post and move it Thank you.

keneso’s picture

For others looking for this kind of problem here is the solution.