• Save
Using spaces (Drupal)
Upcoming SlideShare
Loading in...5
×
 

Using spaces (Drupal)

on

  • 4,143 views

High-level overview of the Spaces module for Drupal and some use cases.

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

Statistics

Views

Total Views
4,143
Views on SlideShare
4,142
Embed Views
1

Actions

Likes
1
Downloads
0
Comments
0

1 Embed 1

https://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Menu settings for the backend\n
  • \n
  • \n
  • \n
  • \n
  • Space overrules preset, overrules site\n
  • 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
  • \n
  • \n

Using spaces (Drupal) Using spaces (Drupal) Presentation Transcript

  • Using Spaces Stijn De Meyere
  • Topics• Spaces in general• Space types• Spaces + PURL• Space controllers• Features integration• Use cases 2
  • What is spaces?http://drupal.org/project/spaces 3
  • From the project pageSpaces is an API module intended to make configuration options generally avaliableonly at the sitewide level to be configurableand overridden by individual "spaces" on a Drupal site. 4
  • My description Spaces is an API module that introducescontext to your site, effectively allowing you to load different configuration. 5
  • What does this mean?• Abstract API• No real UI• For developers 6
  • 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
  • The Magicspaces_load(space_type, id)->activate(); 8
  • The Magic$space = spaces_get_space(); 9
  • The Magic$space->deactivate(); 10
  • Space types 11
  • Space types• Trigger (not as in actions)• A property, anything you want• Plugin based (ctools)• Extend base types 12
  • Provided space types• Organic Groups• Taxonomy• User 13
  • Spaces + PURLhttp://drupal.org/project/purl 14
  • PURL Persistent URLIt 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
  • 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
  • PURL• Rewrite link • hook_url_inbound_alter() • hook_url_outbound_alter() 17
  • The Magic$options = array( purl => array( provider => purl_provider,  id => 5 ),); 18
  • The Magic$options = array( purl => FALSE,); 19
  • Spaces + PURL• extend space_type_purl• Keeps a space alive 20
  • Space controllers 21
  • Space controllersProvides a way to manage configuration for each space. 22
  • Space controllersConfiguration 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
  • Configuration stack site > preset > space 24
  • Configuration stack site > preset > space site > preset > space > user 25
  • Implemented controllers• Variable• Context• (menu reorder) 26
  • Spaces + Features 27
  • 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
  • The Magicspaces[types] = "all"spaces[types] = "og"spaces[types] = "user" 29
  • Spaces DashboardProvides a feature to create/configure a dashboard per space. 30
  • Obligatory screenshot 31
  • Use Cases 32
  • Open Atriumhttp://openatrium.com/ 33
  • Belgian Beer Weekend http://belgianbeerweekend.jp 34
  • Belgian Beer Weekend http://belgianbeerweekend.jp 35
  • Belgian Beer Cafehttp://www.belgianbeercafe.com/ 36
  • Belgian Beer Cafehttp://www.belgianbeercafe.com/ 37
  • Mystery project• Launch with 200+ microsites• Grow up to 800+ microsites• Lots of shared content (± 30 pages/microsite)• Authors & editors per microsite, top-level moderators• Custom entity• Whitelabling 38
  • @stijndmfreelance Drupal dev 39
  • Feedback & follow-up:http://drupalcampgent.be/feedback