How does one go about contextually switching between different layouts that belong to a theme at the moment?

Tried the Delta/Context route for the heck of it, not expecting much (3.x/4.x mismatch, etc). Looked like it ALMOST worked, but not quite.

Delta override array (default layout set to simple)

Array(   
  [theme_THEME_settings] => Array(
     [omega_layout] => epiqo
  )
)

This looks like it's being stored/written correctly, and actually, any other overrides seem to work just fine (including disabling of the entire layout extension). But layouts are no dice.

Not sure if it's on the Delta/Context side or the Omega side. Regardless, I know there's a plan to implement this without needing Delta/Context. Any work-arounds until then?

Comments

jorgensean’s picture

Ooops, look like I was wrong. Disabling any extension in a Delta template disables it for the entire theme.

jorgensean’s picture

AHA - I knew I'd probably find you hook_omega_layout_alter!

A quick example of how to switch layouts based on the content type (in template.php):

function THEME_omega_layout_alter(&$layout) {
    if (arg(0) == 'node' && is_numeric(arg(1))) {
      $nid = arg(1);
      $node = node_load($nid);
      if (isset($node) && $node->type == 'page') {
        $layout = 'epiqo';
    }    
}
fubhy’s picture

Status: Active » Fixed

I consider this fixed then?

vinoth.3v’s picture

Category: support » feature
Status: Fixed » Needs review

Why Don't we merge layouts array info to theme's info, So context layout module can be used to switch between layouts?

fubhy’s picture

Status: Needs review » Fixed

We used to put it into the theme info before. That was problematic and out of scope of what we want to do in a theme. I am not sure if I want to integrate with context layout module. I probably don't... At least we won't have that in the theme. You can of course write your own integration layer (in a module) any time to use context to switch layouts.

fubhy’s picture

We used to put it into the theme info before. That was problematic and out of scope of what we want to do in a theme. I am not sure if I want to integrate with context layout module. I probably don't... At least we won't have that in the theme. You can of course write your own integration layer (in a module) any time to use context to switch layouts.

Please open new issues for separate requests.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

fubhy’s picture

Just to clarify (as this came up on Twitter recently). Omega 4.x should not be used with Delta. I mean.. you CAN use it with Delta but it doesn't really make much sense and should not be required in any case (at least I can't think of a use-case where you would really want to use Delta with Omega 4.x). If you want to switch your layouts contextually and don't like Panels you can do this with the Context Omega module.