High-level overview of the Spaces module for Drupal and some use cases.
Presentation given at DrupalCamp Gent 2012
http://www.drupalcampgent.be/nl/session/using-spaces
4. From the project page
Spaces is an API module intended to make
configuration options generally avaliable
only at the sitewide level to be configurable
and overridden by individual "spaces" on a
Drupal site.
4
5. My description
Spaces is an API module that introduces
context to your site, effectively allowing you
to load different configuration.
5
6. What does this mean?
• Abstract API
• No real UI
• For developers
6
7. What’s it good for?
• Create site sections
• Set up multiple sites with or without shared content
• Create private/public groups
• Give editor/admin rights to certain users on certain
parts of the site
• Enable different features based on the active
space
• ...
7
15. PURL
Persistent URL
It is meant to be a helper for other modules
interested in using elements of the page
request to sustain information between
pages without using a SESSION or other
hackish means.
15
16. PURL Providers
• Path prefixes: http://example.com/foo/node/5
• Path prefix pairs: http://example.com/group/1/node/5
• Query string: http://example.com/node/5?group=1
• Domains: http://example.com/node/5
• Subdomains: http://foo.example.com/node/5
• Path Extensions: http://example.com/node/5.csv
(detection only, no rewriting)
• HTTP User Agent: Mozilla/5.0 (iPhone; U; CPU like
Mac OS X; en) (detection only, no rewriting)
16
17. PURL
• Rewrite link
• hook_url_inbound_alter()
• hook_url_outbound_alter()
17
23. Space controllers
Configuration that lives, or can live, in code can
be overruled.
(or basically: anything that comes with a hook or a
drupal_alter can become space dependent)
23
28. Spaces + Features
• A special controller to manage features in a
space
• Disable / Enable a feature without touching the
feature module
• Provide configuration for your feature
28
Add your own stack, ie: let the user have some control over settings\n
Whenever a space is active, these controllers come in to action and save the settings for that sapce\nEven in the backend. \n
\n
\n
\n
\n
The space settings form (as seen in Open Atrium)\n
\n
It all started with Development Seed and their personal intranet, which led to Open Atrium\nDrupal 6\n
Drupal 7\nSpaces + taxonomy\nTweaks to allow same page in multiple spaces\nBuilt to last a couple of years\nNow with a custom path prefix city + year\nUsed to be domain + prefix\nEach city has it’s own mini site, whenever they are ready with the content they can enable the feature for that mini site\n
Left: Nagoya, beer menu is published, different blocks (same context), different sponsors (same feature)\nRight: Tokyo, beers are currently unknown, feature is disabled\n
Drupal 6\nSpaces + Organic groups\n
Each cafe is a different space \nCafe owner can manage cafe profile + beers, menu\nAdd staff to the cafe > linked to schooling platform\n
Drupal 7\nCustom entity with 2 types -> profile acts as preset, microsite acts as space\nCustom menu controller\nTheme selection\n