Using Drupal's Organic Groups, an Introduction - PNWDS 2013
-
Upload
renee-stephen -
Category
Technology
-
view
2.618 -
download
0
description
Transcript of Using Drupal's Organic Groups, an Introduction - PNWDS 2013
WHO, WHAT, WHERE, WHEN, WHY… HOW?
A whirlwind tour of OG2!
ABOUT US
Renée StephenCMS Developer & Webmaster
UBC Computer Science
Valerie EadesProgrammer AnalystUBC IT Web Servicesdmt.it.ubc.ca
Roadmap
WHAT is it?
HOW does it work?
Examples of WHERE and WHEN (case studies)
WHY use it?
WHO should use it?
WHY use Organic Groups?
Powerful means for users to self organize around content they care about
Flexible user-powered access control
Easy to create complex relationships between content and entities
Plentiful third-party integration
Roadmap
WHAT is it?
HOW does it work?
Examples of WHERE and WHEN (case studies)
WHY use it?
WHO should use it?
WHO needs it?
● need content organization with flexible access control
● want private discussion or document-sharing spaces
● need a wiki or collaborative space, but want better usability and organization
● have subunits wanting to brand and control content but share other areas of their site.
If you:
Roadmap
WHAT is it?
HOW does it work?
Examples of WHERE and WHEN (case studies)
WHY use it?
WHO should use it?
WHAT is Organic Groups (OG)?
It’s a little Drupal site within your Drupal site!
Groups:
● have members, roles, and permissions
● can have $THINGS added to them by their members
Group content can be organized, displayed using group membership and a user’s group access.
WHAT is Organic Groups (OG)... cont?
● Each group is a collection of stuff + permissions
● Users can subscribe, or be added by members
● Members assignedroles, permissions
● Members administer,managing roles,users, permissions.
Another Group
Group
OG relates entities to parent entities
Members and content are allentity references
Roadmap
WHAT is it?
HOW does it work?
Examples of WHERE and WHEN (case studies)
WHY use it?
WHO should use it?
● Memberships (fieldable)● State (active / pending / disabled)● Roles● Permissions
Group entities have attributes:
...which can integrate with:
HOW?
HOW?
Two key fields:Group (int):
is the entity a group?Group audience (entityreference):
assign this content to groups
Plus helper fields:Group visibility (int):
Can user alter content visibilityGroup roles and permissions (int):
Let group manager override defaults
OG Field Settings (admin/config/group/fields)
Roadmap
WHAT is it?
HOW does it work?
Examples of WHERE and WHEN (case studies)
WHY use it?
WHO should use it?
WHERE & WHEN?
Case Study 1: Community sites
Case Study 2: Content organization with baked-in access control
Case Study 3: Subsite management
Case Study 1: Community sites
● Out of the box, OG is a community site-builder
● OpenAtrium, Commons: powered by OG
Case Study 1: Community sites
● Out of the box, OG is a community site-builder
● OpenAtrium, Commons: powered by OG
● Simple alternatives:
● Flag and/or Entityreference, with Node Access Node Reference to pass access
● Content Access, Forum
Case Study 2: an IntranetWe needed self-organizing working groups, committees.
Some wanted:
● universal public access● mixed access● specific access control over some content.
… They all wanted to control memberships and permissions to add / edit / delete.
Classes!
Pros / Cons?
Alternatives? Taxonomy Access Control (TAC), Content Access, Workbench...
OG lets you:
● Delegate “module-lite” permissions to users
● Users manage almost anything in “their” group
Integrations
OG LDAP - OG Menu - OG Workflow - Rules - Views - Tokens - OG Moderation - Profile2 - Panels - Search API - Webform - ...
etc etc etc…
About 387,000 results (0.20 seconds)
Case Study 3: “Multi-site”
Website for organization with sub-units
Share some structures, content, design
Sub-units:
● Have own content requirements● Content editors● Need individualized branding● Want their own domain
Case 3: Example
UBC’s office ofthe Vice President Research &International(VPRI)
reseach.ubc.ca
ors.ubc.ca
sparc.ubc.ca
uilo.ubc.ca
research.ubc.ca/ore
Case 3: The OG Solution
Create a content type “sub-site” as group type
Create a number of group content types:
“Announcement”“Carousel Item”“Event”“Page”“Profile”“Webform”
Use views to create “sub-site” content blocks for shared group content types
Case 3: Organizing with OG Menus
1. When creating new group content types (e.g. Page) – check “Enable for OG Menus”
Case 3: Organizing with OG Menus
2. When creating new “sub-site” check “enable menu for this group”
Case 3: Organizing with OG Menus
Organic Menus have own link under admin->structure
Or can be access by path: admin/structure/og_menu
Case 3: Differentiating Sub-sites by Path Alias
Edit url alias patterns to include “group” name in path
Using token:
[node:og-group-ref]
Needed for:● Views contextual filter● Domain handling
Case 3: Theming Sub-site
Global Base Theme common look and feel
Subthemes for each “sub-site”
Each “sub-site” can apply theme settings, css, scripts, templates as needed
Case 3: Applying Theme to Sub-site
Using “ThemeKey” module(admin/config/user-interface/themekey)
Available Properties:
Group IDGroup Type
Note: group:id = nid for group type entity instance
Case 3: Adding sub-site domain
Server directives:
1. Create server alias for additional domains
Case 3: Redirect Domain Request to Sub-site
Server directives:
2. Use rewrite rules to direct domain to right content path
Mysub.domain.com =>Mysub.domain.com/<subsite>
Case 3: Domain Handling for Drupal Path
1. Make sure right path is attached to right domain Awkward – needs PHP redirect scripts
To sum up….
WHY: Flexibility, user control
WHAT: Entities -> entities, roles, permissions
WHO: needs a better wiki, community space, or sub-site.
HOW:- Organic Groups Documentation: https://drupal.org/node/2014733 - Lullabot training videos:http://drupalize.me/series/organic-groups-drupal-7
The End
Shout out to OG’s maintainer Amitai Burstein: amitaibu