Hi,

I've created a space using a custom type. Pretty simple, it just overrides the Drupal variables "site_frontpage" and "theme_default" when someone is inside of the space (using a PURL prefix). Lovely!

Now, when inside of this space, I'd like to disable certain Contexts, and enable other Contexts. For example, when in the space, display blockB instead of blockA, and set the breadcrumb to something different. Can this be done with Spaces out-of-the-box? If not, what could I do from my module to achieve this?

Thanks!

Comments

Grayside’s picture

I think you are looking for hook_context_load_alter():

function custom_context_load_alter(&$contexts) {
  $space = spaces_get_space();
  if ($space->type == 'subspace') {
    $contexts['some_context']...
  }

Note that conditions cannot be altered here, but you can add, alter, and remove Reactions. Not sure if you can use this to drop the entire Context.

ryan_courtnage’s picture

Thanks, this is what I was looking for.