The Secret Life Of

Organic Groups

 

 

 

January 31, 2015 — DrupalCamp Michigan

Wayne Eaker / @wayneeaker

Organic Groups

From FML to OMG

(and back again)

 

 

January 31, 2015 — DrupalCamp Michigan

Wayne Eaker / @wayneeaker

I'm Wayne Eaker

Independent Drupal developer, site builder, themer

Maintainer of several modules: Node Gallery, Menu Badges, Commerce Goal, and more.

Teach online Drupal training classes at DrupalTutor.com

 

Drupal.org: zengenuity
IRC: zengenuity
Twitter: @wayneeaker

I'm Crazy About
Organic Groups

Overview

  • The "Normal" Use Case
  • How it Works Under the Hood
  • Learning Management Systems
  • Drupal Commerce Integration
  • Premium Content Subscriptions
  • Website "Section" Editors
  • Going Beyond Nodes

Typical Use Case

Typical Use Case

Groups of users sharing node content.

  • Groups can be created by admins or (optionally) by users
  • Groups can have their own roles. (admins, editors, etc.)
  • Permissions can be assigned at the group-level to those roles.
  • Admins can assign group-level roles to members of the group.
  • Membership can be open or moderated.
  • Posting content to the group can be controlled by permission.
  • Viewing content posted to a group can be limited to only members of the group.

Installation

Joining Groups and Posting

Viewing Group Content

Typical Use Case

  • Replacement for a forum
  • Replacement for a mailing list (see Message / Message Notify / Message Digest modules)
  • Intranet
  • Social Network (see Drupal Commons)

OG Architecture

Learning Management
Systems

Learning Management
Systems

Group ---> Class

Group Admin/Manager ---> Teacher

Group Content: Assignments, resources, discussions

Learning Management
Systems

Private Classes/Groups

Selling Organic Groups

Modules Needed

  • Drupal Commerce
  • Commerce License
  • Commerce License OG

Selling Organic Groups

Anonymous Checkouts


Anon Checkout Rule Import

Selling Organic Groups

Selling Premium Content

Typical Approach

  • Create role for "subscriber"
  • Use Content Access module (or similar) to restrict viewing of premium content to subscriber role
  • Sell access to role, either manually or with Commerce License Role

Typical Approach

  • Problems scaling up to multiple content libraries: could end up with lots of roles.
  • Permissions and other UI a mess when you have a lot of roles.
  • No easy way to control authorship permission by content libary

Alternative: Moar OG!

  • Set up each content library as a group
  • Create editor/admins for each group
  • Post your premium content to the groups
  • Sell access to the group as before
  • Email notifications: Message stack: Message / Message Notify / Message Digest

Editorial Sections On Your Website

Editorial Sections On Your Website

OG can be used to grant create/edit priviledges to parts of your site

  • Each section is a group.
  • Add editors to group, give them a role that can create/edit pages, etc.
  • Use OG Menu module to allow editors to maintain a section-level menu.

Setup

OG Menu Module

Using Other Entity Types

The Situation

  • You are building social network or intranet site
  • You're already using Organic Groups for group discussions
  • You've been ask to implement a user "follow" feature

User Follow: The Common
Approach

  • Use User Relationships module
  • User Relationships already has UI for users to follow others
  • You can use Views to show posts from users with whom you have a relationship

User Relationships: Why Not?

  • It's a completely different system: DB tables, configuration, etc.
  • Another set of modules to keep up to date
  • What if you want to show posts from both groups and followed users in a single stream? (like Facebook)

 

There's nothing wrong with User Relationships module, but you already have a system for users subscribing to content on your site: Organic Groups

Start with Normal Groups

Add The Crazy

Other Fever Dreams

  • Create re-usable forms in groups with EntityForm: Assign submissions to group in context
  • Build a marketplace site: Nodes as Group, Commerce Products / Line Items as Group Content
  • Reviews: Commerce Product as Group, Review Nodes as Group Content (Bonus: purchasers as group members)
  • Collaborative Image Galleries: Nodes as Group, File Entity as Group Content
  • Taxonomy Subscriptions: Taxonomy Term as Group, Nodes as Group Content

OG: It's not just for groups!

  • Can be useful anytime you want to group related entities together
  • Especially useful if there is a group of users related to the group
  • For non-node uses, you'll probably have to write your own UI
  • Relatively simple API for adding / removing items from groups (Use og_group() and og_ungroup(). NEVER create og_membership entities directly!)
  • Views and Rules support built-in

The Secret Life of Organic Groups
January 31, 2015 — DrupalCamp Michigan
Slides and Links: http://wayneeaker.com/og-talk

Wayne Eaker / @wayneeaker