Code for view, and module name in path besides node id 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?

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


This is the structure:


example.com/node/2 &lt;&lt;&lt; snip ok
example.com/node/3 &lt;&lt;&lt; snip ok
example.com/node/4 &lt;&lt;&lt; snip ok
example.com/node/gallery &lt;&lt;&lt; view name/path - what code do I need
example.com/node/contact &lt;&lt;&lt; contact module - what code do I need


Thank you
In that same block of code, can do an arg() check. 

$node = menu_get_object(); 
$menu_image = 'arrow_home.png'; 
if (!empty($node)) { 
  $images = array(2 =&gt; 'arrow_home.png', 3 =&gt; 'arrow_formazione.png', 4 =&gt; 'arrow_workshop.png', 5 =&gt; 'arrow_raccontabito.png'); 
  $menu_image = isset($images[$node-&gt;nid]) ? $images[$node-&gt;nid] : $menu_image; 
} 
if (arg(1) == 'gallery') {
  $menu_image = 'arrow_gallery.png';
} 
elseif (arg(1) == 'contact') { 
  $menu_image = 'arrow_contact.png';
}


Note: This will only work as long as the URL structure stays the same.

Also, this code depends on where you are preprocessing the image. If you are using template_preprocess_node() the above will not work because those two pages, even though they are located at the node path, are not nodes.