3

I see one can edit a membership entity by going to:

group/node/204/admin/people/edit-membership/32

What is the URL to view the entity?

I see the membership entity has a display mode that allows you to rearrange the fields but there is no view link in the OG membership (people) admin area.

3
  • Where do you find the display mode setting for membership entity? Nov 25, 2015 at 8:56
  • If you'd have such URL to "view" such entity, what kind of details/content should such view have? Nov 25, 2015 at 22:06
  • @Елин Й when you go to /admin/config/group/group-membership you can "manage fields" and "manage display", like other entities. There just isn't an actual display URL Dec 1, 2015 at 16:53

2 Answers 2

7
+350

I don't think that there is a page you can view the membership. I've just skimmed the code of OG module and didn't found any relating part which displays a membership in a separate page.

However, since memberships are entities, it should be possible that you can setup a view which takes a membership id as contextual filter and display it in a selected view mode.

Here is how you do that with views:

  1. Create a new view visiting admin/structure/views/add
    • Give your view a name like View Membership
    • Set it to Show OG Membership
    • Set a Path with a placeholder like view-membership/%
    • Display format Unformatted list of Rendered entity
    • Items to display 1, uncheck Use a pager
    • Continue & Edit
  2. Under Advanced section, add a contextual filter OG membership: Og membership ID
    • WHEN THE FILTER VALUE IS NOT IN THE URL: Show "Page not found"
  3. Save
  4. Visit the page view-membership/<membership_id> and you'll see the membership entity.
4

There is no view link because it does not exist.

As you've already mentioned: a membership is an entity. Entities, by default, don't have display pages. You use a custom entity if the data does not necessary has to be publicly displayed on its own. Otherwise, you could use nodes (which are nothing more than extended entities).

In this case, the entity og_membership is used to store data about which users and nodes are connected. In addition, OG Groups provides some views which generate lists with these memberships. Of course, you can also create your own views.

The fields you attach to the og_membership entity can be displayed in these views.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.