Spaces & Features

Last updated on
21 November 2016

Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites

Introduction

Spaces is an API module intended to make configuration options generally available only at the sitewide level to be configurable and overridden by individual "spaces" on a Drupal site. It has been described as:

  • A way to make one Drupal site act like several sites
  • A way to provide much more configurable, full-feature Organic Groups or user homepages
  • A generalized API for contextual configuration

Spaces leverages Features to allow administrators and other modules to define "features" in Drupal. These features can then be enabled, disabled, or set to more specific settings per "space."

A space is essentially some aspect of Drupal that might be leveraged to group content and settings together. For example, a group space might act as a collaborative workspace for a team; a user space might act as a personal blog, calendar, and gallery; a taxonomy space might act as a whole thematic section of a site.

Installation

A typical space setup consists of:

  1. spaces.module -- the core Spaces module. Required.
  2. Any number of space type modules. Currently, the following space type modules are packaged with spaces: spaces_site, spaces_og, spaces_user, spaces_taxonomy. At least one of these modules should be enabled, and more than one can be utilized simultaneously.
  3. Any number of spaces feature modules. Spaces comes with the module spaces_core which provides integration against the Drupal core blog and book modules. You can build your own features for use with spaces fairly easily using CCK, Views, Context, Features, and other Drupal modules.

Once some combination of these modules is installed, you will want to do some additional setup.

Menu setup

To gain access to the current space's menu, you can set your primary or secondary navigation links to the "Spaces" menu (admin/build/menu/settings). For greater control of these links in your theme, you can use the API function spaces_features_menu() to retrieve the current space's links at any time.

Spaces also provides some useful administration links that you may want to include in your theme. You can access these using the API function spaces_space_links().

Path prefixing

Spaces are based on the concept of path prefixing. A url prefix is defined for each space, and whenever that url prefix is present the associated space will be enabled.

For example, when creating a new group using spaces_og, you might define a prefix "knitting" for the group. To access the group's space, simply go to /knitting on your site.

Features and settings

Once you've set up your first space, you can customize the settings and features for that space using its space settings page. The location of this page varies by space type -- for groups and users, it is located under the "Features" tab on the group node (e.g. node/43/spaces/features or user/7/spaces/features).

Spaces presets

In addition to customizing features and settings on a per-space basis, you can provide presets to your users to make setting up a new space very easily. With the space presets administration page (admin/build/spaces), you can add new presets (the process is nearly identical to configuring features and settings for a space), disable/enable existing presets, and choose a default for each space type on your site.

Help improve this page

Page status: No known problems

You can: