Posted 04.19.2010 by Jack
Presented by Young Hahn of Development Seed
Open Atrium & Context
- Open Atrium = open source intranet package, open sourced summer 2009 for collaboration by small teams
- Context: module for triggering reactive behaviors within a page load. Controlling block visibility, menu trails, page classes, and page templates...
- before Context you had to use arguments to figure out where you were in your Drupal site and do stuff based on it - logic about where you're are is spread out all over your site in little code snippets
- questions like am I viewing a blog node? am I on the blog view? am I on the blog edit form?
- Instead, the question can be "Am I in the blog section"? - insert an intermediary question
- based on certain conditions, you'll get certain reactions - when blog section is active (conditions), you'll get different output (blocks, etc - reactions)
- Context in Atrium: casetracker context, casetracker-book (only active when viewing a book page within the casetracker), casetracker-project (only active when viewing a project within the casetracker)
- global context - contexts are always active: atrium-intranet-global (always active, provides sitewide blocks), layout-login (sets a thinner page layout on login, user registration, password lost, other related forms)
- multiple contexts layer together to create one "page"
- Context editor - very handy feature from Contexts 3 in Admin toolbar that lets you edit contexts inline - drag and drop blocks, switch themes and layout options, etc
Groups and PURL
- OA started out using Organic Groups
- How does OG figure out what group is active? Sometimes the URL explicitly specifies the group ID, sees whether the current node belongs to a group ($node->og_groups), or user's session includes last viewed group ($_SESSION['og_last'])
- Sometimes though those determinations conflict and you don't wind up in the right group
- PURL - Persistent URL: library for capturing and abstracting request handling that goes beyond what the Drupal core menu system provides. Detection of request components, like subdomain, path prefix...
- demonstration of how Flickr, Drupal internationalization (i18n) do similar things
- Dev Seed took these examples and applied them to groups.
- example.com/planning/node/5 comes through - PURL recognizes the "planning" element and strips it out, passes that to OG, passes the stripped URL to Drupal, but the "planning" element remains
- user agent, domain/subdomain, path prefix, query string - all can be parsed by PURL
- examples of how PURL is used on Managing News, afghanistanelectiondata.org
- PURL is independent of session, login, cookies, etc - truly persistent!
- 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
- A space is a configuration environment that is triggered or made active by some condition.
- configuration object - a drupal site building or configuration structure (variables context and views, not nodes users taxonomy or other content)
- override variables when a space is active; reverts to default when no space is active
- Spaces lets you customize contexts
- Spaces Custom Text module - lets you customize strings on a per-space basis
- controller plugin - CTools plugin that manages retrieval and storage of overrides for a given object type
- controller sits between object storage and loader - loads up things for the active space if they exist, falls back to object storage if not
- spaces preset - set of overrides that can be used as starting template for new spaces
- controller first checks active space, then falls back to presets (for all spaces?), then falls back to object storage