{"id":15172945,"url":"https://github.com/gizra/og","last_synced_at":"2025-10-01T09:30:55.471Z","repository":{"id":880914,"uuid":"22711459","full_name":"Gizra/og","owner":"Gizra","description":"https://www.drupal.org/project/og","archived":true,"fork":false,"pushed_at":"2024-08-18T18:49:23.000Z","size":8764,"stargazers_count":92,"open_issues_count":144,"forks_count":133,"subscribers_count":25,"default_branch":"8.x-1.x","last_synced_at":"2024-09-28T10:24:23.521Z","etag":null,"topics":["drupal","og"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Gizra.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-08-07T06:48:42.000Z","updated_at":"2024-08-18T18:49:54.000Z","dependencies_parsed_at":"2023-07-05T18:49:16.781Z","dependency_job_id":"1e611a43-3647-42e4-8796-89623220c636","html_url":"https://github.com/Gizra/og","commit_stats":{"total_commits":5603,"total_committers":180,"mean_commits":"31.127777777777776","dds":0.7258611458147421,"last_synced_commit":"337a922a2bb8c65b00c81181e6f50143d6e94f95"},"previous_names":[],"tags_count":121,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gizra%2Fog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gizra%2Fog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gizra%2Fog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gizra%2Fog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gizra","download_url":"https://codeload.github.com/Gizra/og/tar.gz/refs/heads/8.x-1.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234852335,"owners_count":18896850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drupal","og"],"created_at":"2024-09-27T10:24:25.473Z","updated_at":"2025-10-01T09:30:50.098Z","avatar_url":"https://github.com/Gizra.png","language":"PHP","readme":"This repository is now archived. Active development has moved to https://www.drupal.org/project/og\n\n![Status](https://travis-ci.org/Gizra/og.svg?branch=8.x-1.x)\n\n## DESCRIPTION\n\nThe Organic Groups module (also referred to as the 'og' module), provides users\nthe ability to create, manage, and delete their own 'groups' on a site.\nEach group can have members, and maintains a group home page which individual\ngroup members may post into. Posts can be sent to multiple groups (i.e. cross-\nposted), and individual posts (referred as 'group content') may be shared with\nmembers, or non-members where necessary.\nGroup membership can be open, closed or moderated.\n\n## TERMS AND DEFINITIONS\n\n- GROUP: A single node which can have different content types and users\n  associated with it.\n- GROUP CONTENT: Content such as nodes or users, which are associated with a\n  group.\n- GROUP ADMIN: Is a privileged user with permission to administer particular\n  activities within a group.\n- SITE ADMIN: Compared to group admin, a site admin is granted access to all\n  groups operating within a site. The site admin can specify the permissions\n  group admins are granted in order to control their group related activities,\n  while keeping other permissions out of their reach.\n- GROUP CONTEXT: Whenever an individual piece of content such as a node or a\n  user is viewed, the module attempts to determine if the content is associated\n  with a particular group.\n  The group context is later on used to determine which access rights the user\n  is granted. For example, in a particular group context the user can edit\n  nodes, but is only allowed to view the nodes in a different group context.\n  The group context can also be used by custom modules to determine different\n  behaviors. For example, displaying different blocks on different groups,\n  switching to a different theme, etc.\n- ENTITY: Nodes, users, and taxonomy terms, are examples of Drupal entities.\n  Organic Groups allows each individual Drupal entity type to be associated with\n  a group or with a group content. This means that you can associate different\n  users (as group content) to a certain user (as a group).\n\n## GROUP ARCHITECTURE\n\nAt the lowest level the module associates content types with groups. Above this\nlevel is the role and permissions layer, which operates at the group level.\nThe Organic Groups module leverages Drupal's core functionality, especially the\nfield API. This means that a content type is associated with a group, by setting\nthe correct field value.\nUsers are also allowed to select the groups that will be associated with the\ncontent from a list of groups, which they have authorization to view.\nAs is the case with Drupal itself, in Organic Groups different permissions can\nbe assigned to different user roles. This allows group members to perform a\ndifferent set of actions, in different group contexts.\n\n### OG Membership Entity\n\nThe membership entity that connects a group and a user.\n\nWhen dealing with non-user entities that are group content, that is content\nthat is associated with a group, we do it via an entity reference field that\nhas the default storage. The only information that we hold is that a group\ncontent is referencing a group.\n\nHowever, when dealing with the user entity we recognize that we need to\nspecial case it. It won't suffice to just hold the reference between the user\nand the group content as it will be laking crucial information such as: the\nstate of the user's membership in the group (active, pending or blocked), the\ntime the membership was created, the user's OG role in the group, etc.\n\nFor this meta data we have the fieldable OgMembership entity, that is always\nconnecting between a user and a group. There cannot be an OgMembership entity\nconnecting two non-user entities.\n\nCreating such a relation is done for example in the following way:\n\n```php\n $membership = Og::createMembership($entity, $user);\n $membership-\u003esave();\n```\n\nNotice how the relation of the user to the group also includes the OG\naudience field name this association was done by. Like this we are able to\nexpress different membership types such as the default membership that comes\nout of the box, or a \"premium membership\" that can be for example expired\nafter a certain amount of time (the logic for the expired membership in the\nexample is out of the scope of OG core).\n\nHaving this field separation is what allows having multiple OG audience\nfields attached to the user, where each group they are associated with may be\na result of different membership types.\n\n## INSTALLATION DRUPAL 8.x\nNote that the following guide is here to get you started. Names for content\ntypes, groups and group content given here are suggestions and are given to\nprovide a quick way to get started with Organic groups.\n\n1. Enable the Group and the Group UI modules.\n2. Create a new content type via admin/structure/types/add. Call it \"Group\",\n   and click on tab \"Organic groups\" then define it to be of Group type.\n3. Create a second content type. Call it \"Group content\", and click on tab \n   \"Organic groups\" then set it to be of Group content type.\n4. Add a Group by going to node/add/group. Call it First group.\n5. Add a Group Content by going to node/add/group-content. In the Groups\n   audience field, select First group. In the group content view a link was\n   added to the group.\n6. Click on the Group link. In the group view, a new tab was added labeled\n   Group.\n7. Click on the Group tab. You will be redirected to the group administration\n   area. Note that this is the administration of First group only. It will not\n   affect existing or new groups which will be created on the site.\n8. You are now presented with different actions you can perform within the\n   group. Such as add group members, add roles, and set member permissions. You\n   will notice that these options have the same look and feel as Drupal core in\n   matters relating to management of roles and permissions.\n9. You can enable your privileged users to subscribe to a group by providing a\n   'Subscribe' link. (Subscribing is the act of associating a user with a \n    group.)\n   To show this subscribe link:\n   1. Make sure you have the Group UI module enabled\n   2. Go to admin/config/group/permissions and make sure that the \"Subscribe \n       user to group\" permission is given to the appropriate user-roles.\n   3. Navigate to the \"manage display\" tab of your content type\n      (admin/structure/types/manage/group/display)\n       and choose the Group subscription format for the Group type field.\n   4. Back in the group view you will now notice a 'Subscribe' link (If you are \n       the group administrator it will say \"You are the group manager\").\n10. In order to associate other entities with group or group content, navigate\n    to Organic Groups field settings\", in admin/config/group/fields.\n11. In order to define default permissions for groups that are newly created or\n    to edit permissions on all existing groups, navigate to the Group\n    default permissions page. Important permissions in this page are the ones\n    under the administer section. These permissions are what enable group admins\n    to have granular control over their own group. This means, that if you as\n    the site admin, don't want to allow group admins to control who can edit\n    nodes in their own group, you need to uncheck those permissions.\n\n## DEVELOPERS \u0026 SITE BUILDERS\n\n- Views integration: There are some default views that ship with the module.\n  Follow those views configuration in terms of best practice (e.g. adding a\n  relationship to the group-membership entity instead of querying directly the\n  group-audience field).\n- Token integration: Enable the entity-tokens module that ships with Entity API\n  module.\n- Rules integration: Organic groups is shipped with a Rules configuration that\n  allows simple notification. You can disable it or clone and change its\n  behaviour.\n- Devel generate integration: Enable devel-generate module to create dummy\n  groups and groups content.\n- You may craft your own URLs to prepopulate the group-audience fields\n  (e.g. node/add/post?field_group_audience=1 to prepopulate reference to\n  node ID 1), using the \"Entity reference prepopulate\" module\n  http://drupal.org/project/entityreference_prepopulate\n  and configuring the correct settings in the field UI. Read more about\n  it in Entity reference prepopulate's README file.\n  Further more, when Entity reference prepopulate module is enabled the node\n  \"create\" permissions will be enabled even for non-members. In order to allow\n  a non member to create a node to a group they don't belong to, you should\n  craft the URL in the same way. OG will recognize this situation and add the\n  group as a valid option under the \"My groups\" widget.\n- When deleting groups, it is possible to delete orphan group-content, or move\n  it under another group. In order to do it in a scalable way, enable the\n  \"Use queue\" option, and process it using for example:\n  drush queue-run og_membership_orphans\n\n## API\n\n```php\nuse Drupal\\og\\Og;\nuse Drupal\\og\\OgGroupAudienceHelperInterface;\n\n// Define the \"Page\" node type as a group.\nOg::groupTypeManager()-\u003eaddGroup('node', 'page');\n\n// Add OG audience field to the \"News\" node type, thus making it group content.\nOg::createField(OgGroupAudienceHelperInterface::DEFAULT_FIELD, 'node', 'news');\n```\n\n## Access control\n\nSee [Access control for groups and group content](docs/access.md).\n\n## DRUPAL CONSOLE INTEGRATION\nThe Drupal 8 branch integrates with Drupal Console to do actions which used by\ndevelopers only. The supported actions are:\n* Attaching OG fields to entities\n\n**Please notice:** You need to install DrupalConsole 1.0.0-RC5 and above.\n\n## FAQ\n\nQ: How should I update from Drupal 6?\nA: Run update.php; Enable the og-migrate module and execute all the migration\n   plugins.\n\nQ: How should I update from a previous Drupal 7 release (e.g. 7.x-1.0 to\n   7.x-1.1)?\nA: Same as updating from Drupal 6 -- Run update.php; If requested enable the\n    og-migrate module and execute all the migration plugins.\n\nQ: How do I use OG tokens with pathauto module to craft the url alias.\nA: After enabling entity-tokens module you will have some tokens exposes by\n   Organic groups. However you are not able to do something like\n   [node:og_membership(1):group:label].\n   See http://drupal.org/node/1088538#comment-4376910\n\nQ: Must I use Panels module along with Organic groups?\nA: No. However note that the maintainer of the module highly recommends using\n   it, and considers it as good practice.\n\n## CREDITS\n\n* Organic groups for Drupal 5 and 6 authored by Moshe Weitzman -\n  \u003cweitzman AT tejasa DOT com\u003e\n* Current project maintainer and Drupal 7 author is Amitai Burstein (Amitaibu) -\n  gizra.com\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgizra%2Fog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgizra%2Fog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgizra%2Fog/lists"}