Using spaces (Drupal)

6,236 views
5,915 views

Published on

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

Published in: Technology, Business
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
6,236
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
0
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide
  • \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)

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

    ×