3

I want to add a condition of what type of space is currently active on the site. Does anyone know of a module that supports this?

I notice that spaces is setting a context for us, but I cannot find the relevant plugin or set the condition up in Context UI.

function spaces_set_space($space = NULL) {
  static $active_space;
  if (isset($space)) {
    $active_space = $space;
    if (module_exists('context') && 
        $plugin = context_get_plugin('condition','spaces_type')
        ) {
        $plugin->execute($space);
    }
  }
  return isset($active_space) ? $active_space : FALSE;
}

2 Answers 2

1

If you can figure out the name of the contexts made available from spaces, you can use the condition that is triggered by other active contexts. I personally have not heard of spaces creating context on their own however. You may also consider writing your own plugin/module as this is relatively simple to do. I myself used the path condition files to create the context keywords module(http://drupal.org/project/context_keywords). You could honestly probably reuse 90% of the code from mine, and just change the part that returns true or false.

1

That code you posted looks like it would do what you wanted? Maybe you'd be better off filing an issue in the Spaces issue queue rather than here?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.