DrupalCon San Francisco, The Heart of Open Atrium: Context, PURL and Spaces

Young Han from Development Seed presented killer elements that drive their Open Atrium distribution of Drupal in The Heart of Open Atrium: Context, PURL and Spaces.

Context Module

  • Can check for a condition, and respond or act on that condition
  • Example of a “Blog” section or context
    • node page
    • view
  • A “context” is just a name for an idea. You can call it a “section” or anything.
  • Examples in Open Atrium: casetracker, casetracker_book, casetracker_project
  • A Global context is also available
  • Multiple contexts can be active simultaneously, such as globel + blog + casetracker + …

Context Conditions could include

  • Listing
  • Page
  • Section

Responses could include

  • modify theme settings
  • control block visibility

With Context 3.x, Admin module, and jquery ui, an “inline context editor” becomes available, allowing you to work with blocks directly and immediately see results before saving.

Groups

In working with many clients, Development Seed wanted to extend their internal intranet to their individual clients in a controlled and secure way.  Enter Organic Groups module.

Existing ways OG detects what the active group is.

  • node/add/foo?gid[]=1
  • the group that the current node primarily belongs to
  • the group of the user’s last session

This can break down if for example the user is working in multiple tabs.  PURL enters.

PURL

PURL = “Persistent URL”.  Detects a portion of a custom URL, and ensures that that URL is used as the user continues to navigate around the site.

Parts of the URL define the context. For example, see some Flickr URLs.

  • http://www.flickr.com/photos/developmentseed/4518312400
  • http://www.flickr.com/photos/developmentseed/4518312400/in/set-72157623846890026/

In Drupal, could define groups this way:

  • /planning/node/5
  • /communication/node/5
  • /development/node/5

Could also respond to other factors besides URL

  • User Agent
  • Query String (?group=3 or ?display=map)
  • Path Prefix

Simple method to create new PURL behaviors.

Each group can be customized, such as for dashboards, and enable specific features.

Spaces

Enables overriding drupal configurations within any specific space or context.  Lets you control the result of “variable_get()” based on space or context.

Spaces Custom Strings enables changing bits of text based on space or context.

A controller plugin from ctools is what handles the detection of context.

Groups of overrides can be saved into presets.  Examples in Open Atrium: Private Groups, Public Groups.

Leave a Reply

  Wordpress Theme Protected By Wp Spam Blocker