Change Omega4 Layout Based on Content Type via template.php I want to set Omega4 Layout defaults based on Content Type. I am trying to use the following code, but the hook_omega_layout_alter doesn't seem to use the $node variable. What am I missing?

I have already referenced Omega override simple-layout.tpl.php for content types but, once I try and and a switch statement based of $node->type it stops working.

What can I do to set the default Omega4 Layout based on Content Type using the hook_omega_layout_alter function?

function THEME_omega_layout_alter(&amp;$vars, &amp;$layout) {
  $node = $vars['node'];
  switch ($node-&gt;type) {
    case "article":
        $layout = 'article';
        break;
    case "blog":
        $layout = 'blog';
        break;
    case "market":
        $layout = 'market';
        break;
    case "merchant":
        $layout = 'merchant';
        break;
    case "product":
        $layout = 'product';
        break;
    case "update":
        $layout = 'update';
        break;
  }

}
As per referenced question I would go with something like the following:

function THEMENAME_omega_layout_alter(&amp;$layout) {
  if (arg(0) == 'node' &amp;&amp; is_numeric(arg(1))
      &amp;&amp; $node = node_load(arg(1))) {
        switch ($node-&gt;type) {
          case 'article':
            $layout = 'article';
            break;
          case 'blog':
            $layout = 'blog';
            break;
          default:
            $layout = 'default';
        }
   }
}