47
PRESENTS

Adding context to your site using Drupal Organic Groups

  • Upload
    nascom

  • View
    331

  • Download
    0

Embed Size (px)

DESCRIPTION

Using Drupal Organic Groups to build communities is cool. But why not look a bit further? We started experimenting and found new ways to use the flexible built-in API. It is perfect for setting up very complex structures within a single Drupal environment. It lets you create small or larger sections that can start leading a life of their own.

Citation preview

Page 1: Adding context to your site using Drupal Organic Groups

PRESENTS

Page 2: Adding context to your site using Drupal Organic Groups

Context toevoegen aan uw Drupal site met Organic GroupsDrupal User Group

drupal.be

Page 3: Adding context to your site using Drupal Organic Groups

Me

Stijn De Meyere

Drupal Developer

@stijndm

Page 4: Adding context to your site using Drupal Organic Groups

Organic Groups

Page 5: Adding context to your site using Drupal Organic Groups

Enable users to create and manage their own

'groups'. Each group can have subscribers, and

maintains a group home page where subscribers

communicate amongst themselves.

Page 6: Adding context to your site using Drupal Organic Groups

Agenda● Cases

● Basis concepten van Organic Groups

● Welke API is er voor handen

● Integratie en uitbreiding

● Uitlichten cases

● Nababbelen

Page 7: Adding context to your site using Drupal Organic Groups

Inspireren

Page 8: Adding context to your site using Drupal Organic Groups

Cases

Page 9: Adding context to your site using Drupal Organic Groups

3 cases

● Corporate site met brandsites

● Boekenplatform met e-commerce integratie

● Ledenmanagementplatform

Page 10: Adding context to your site using Drupal Organic Groups

Deme Brandsites

Page 11: Adding context to your site using Drupal Organic Groups

Deme Brandsites - http://deme-group.com

Page 12: Adding context to your site using Drupal Organic Groups

Deme Brandsites - http://deme-group.com

Page 13: Adding context to your site using Drupal Organic Groups

Deme Brandsites - http://deme-group.com

Page 14: Adding context to your site using Drupal Organic Groups

Uitdagingen

● Gedeelde content over corporate site en brandsites

● Delegeren van content over de verschillende brandsites

● Verschillende content beheerders, met eigen rollen en

rechten

● Content workflows

● Zelf aanmaken en beheren van brandsites

● Brandsite beheerders

● (Beperkte) meertaligheid

Page 15: Adding context to your site using Drupal Organic Groups

Boeda boekenplatform

Page 16: Adding context to your site using Drupal Organic Groups

Boeda boekenplatform

Page 17: Adding context to your site using Drupal Organic Groups

Boeda boekenplatform

Page 18: Adding context to your site using Drupal Organic Groups

Uitdagingen

● Verschillende type gebruikers

○ Uitgevers

○ Vertegenwoordigers/verkopers

○ Boekhandels

● Elke entiteit kan meerdere beheerders hebben

● Bepaalde gebruikers moeten overkoepelend kunnen werken

● E-commerce

Page 19: Adding context to your site using Drupal Organic Groups

KSJ Leden management

Page 20: Adding context to your site using Drupal Organic Groups

KSJ Leden management platform

Page 21: Adding context to your site using Drupal Organic Groups

KSJ Leden management platform

Page 22: Adding context to your site using Drupal Organic Groups

● Verschillende type leden

● Verschillende rechten afhankelijk van uw groep en rol binnen

uw groep

● Groep-overkoepelende rollen

● Bijhouden van ledengeschiedenis

● Groepen hiërarchie

Uitdagingen

Page 23: Adding context to your site using Drupal Organic Groups

De basics

Page 24: Adding context to your site using Drupal Organic Groups

Organic groups basics

● Group and Group Audience

● OG membership

● OG permissions

● OG roles

● OG context

Page 25: Adding context to your site using Drupal Organic Groups

Group and Group Audience

Group

Field dat een entity als group aanduidt.

Niet zichtbaar in UI.

Group Audience

Entity reference field met specifiek group gedrag.

Koppelt een entity aan een groep.

Page 26: Adding context to your site using Drupal Organic Groups

OG Membership

Entity dat een lidmaatschap aanduidt.

bv: gebruiker X is lid van groep 1

Er kunnen verschillende types gedefinieerd worden.

Vergelijkbaar met type krantenabonnement: 6 maanden vs 12 maanden.

Page 27: Adding context to your site using Drupal Organic Groups

OG roles & permissions

Een interne rollen systeem dat toelaat om op groepniveau rechten toe te kennen.

bv: een rol die toelaat nieuwsberichten te publiceren in een groep

Page 28: Adding context to your site using Drupal Organic Groups

OG context

Een conditioneel systeem die toelaat een groep te activeren op basis van bepaalde kenmerken

Net als de core language negotiation

Page 29: Adding context to your site using Drupal Organic Groups

OG API

Page 30: Adding context to your site using Drupal Organic Groups

Dé beste resource voor wat OG doet en kan:

● og.module● og.api.php

Page 31: Adding context to your site using Drupal Organic Groups

Wat je moet weten

(1) Entity reference wordt onderschept en opgeslaan als og_membership.

EntityFieldQuery kan wel nog gebruikt worden. Zie:

og_entity_query_alter()

og_query_og_membership_alter()

(2) Alles kan van alles lid zijn.

Elke entity kan als groep dienen, elke entity kan als lid fungeren.

Page 32: Adding context to your site using Drupal Organic Groups

Groep of groep content

og_is_group($entity_type, $type)

og_is_group_type($entity_type, $bundle_name)

og_is_group_content_type($entity_type, $bundle_name)

Page 33: Adding context to your site using Drupal Organic Groups

Iets of iemand lid maken

og_group($group_type, $gid, $values, $save_created)

og_ungroup($group_type, $gid, $entity_type, $etid)

og_get_entity_groups($entity_type, $entity, $states)

Page 34: Adding context to your site using Drupal Organic Groups

Rechten beheren

hook_og_permission()

og_user_access($group_type, $gid, $string, $account, ...)

hook_og_user_access_alter()

og_role_grant($group_type, $gid, $uid, $rid)

og_role_revoke($group_type, $gid, $uid, $rid)

og_roles()

og_get_user_roles()

Page 35: Adding context to your site using Drupal Organic Groups

Lidmaatschap opvragen

og_is_member($group_type, $gid, $entity_type, $entity)

og_get_groups_by_user($account, $group_type)

og_get_entity_groups($entity_type, $entity, $states)

Membership laden op basis van groep en entity

og_get_membership()

Page 36: Adding context to your site using Drupal Organic Groups

When funny things happen

og_flush_caches()

typical databse caches

og_invalidate_cache()

includes static caches

Page 37: Adding context to your site using Drupal Organic Groups

Context

Ook wel, welke groep is er nu eigenlijk actief

og_context($group_type)

Of als je een specifieke groep wil activeren

og_context($group_type, $group)

hook_og_context_negotiation_info()

Page 38: Adding context to your site using Drupal Organic Groups

Rules

Let rules do all the leg work.

Page 39: Adding context to your site using Drupal Organic Groups

Integregeren en uitbreiden

Page 40: Adding context to your site using Drupal Organic Groups

Code, cases, demos

Te bekijken

● OG Context

● Autopopulate

● PURL

● Variable & variable realms

● Views integrations

● Dynamic nodequeues

Page 41: Adding context to your site using Drupal Organic Groups

Limieten & lessen

Page 42: Adding context to your site using Drupal Organic Groups

Revisions zijn lastigIn het algemeen geschiedenis bijhouden van leden en status

Page 43: Adding context to your site using Drupal Organic Groups

Globale adminsUser 1 rechten dupliceren

Page 44: Adding context to your site using Drupal Organic Groups

Multiple memberships & types

OG Membership is nogal single minded

Page 45: Adding context to your site using Drupal Organic Groups

OG Permissions vs Site Permissions

Dat loopt soms door mekaar en kan onverwachte resultaten geven. Goed over nadenken.

Page 46: Adding context to your site using Drupal Organic Groups

Heb ik iets gemist?

Page 47: Adding context to your site using Drupal Organic Groups

C-MINE 1 BUS 13Evence Coppéelaan 91

3600 GenkBelgium

Phone +32 89 20 15 00Fax +32 89 20 15 01

[email protected]

Thanks!