I would like to be able to use Organic Groups in Drupal 7 to create small sites within my site. For example, it would be a video site but there would be certain channels. Each channel would have different theming and content and videos related to that channel.

My question is, what's the best way to create, manage, and present a menu that is specific to that organic group? I'm thinking that the menu should have two levels and would point to content most likely within the group but it could even link out to other sites.

Is it possible to create a simply menu in Drupal, and then link the OG to that menu? I'm doing custom theming for my group so it would be easy for me to cram that menu in the header or use blocks.

I'm dying to know... so I'll put a bounty ($20 via PayPal) on this for the first person who can come up with an elegant solution (i know that's subjective but i'm not stingy). It would also be nice if the menu was tied into the permissions for the group so only groups owners/members could manage it.

Comments

tenken’s picture

Not looking for any reward -- but I'm looking for a similar solution right now. As a tertiary solution ... You can try to use OG D7's ACL submodule to define 1 Role per OG group. Then you could use the http://drupal.org/project/menu_per_role to define which menu(s) a given Role has access to in the create/edit screens for content.

I'm not sure if this answers your question and there is OG_Menu which at some point is in line to be updated ... but this may be your best bet at this time.

mlconnor’s picture

Thx d.gurba, I think the OG Menu is probably the way to go as well but no port to Drupal 7 yet. I thought it may be a case where the OG Menu plug-in was no longer necessary due to features native to D7 Organic Groups.

It's almost like it would be best to create a CCK field which gave me the ability to reference a menu so that the organic group owner could select the menu for his group. I could then render that in the theming layer when I see that the group is an OG type. Or perhaps it's best to just assign the menu block to that group page.

It seems like no matter how many sites I build in Drupal, I always struggle with menus.

mlconnor’s picture

I think perhaps the best way to handle this is to use the Block Reference module and add a Block Reference in the Group Content Type to the menu that should be shown for that group. The theming layer could then handle and nuance details around placement.

jastraat’s picture

I handled this with flag + views. Flag text is "provide a menu link" and it's displayed on the node edit form. The menu displayed within the site is actually a view that takes the current group as an argument and then displays all flagged nodes within that group.

awasson’s picture

jastraat, I can see how you could make the menu linking out to other groups using your flag + views but did you solve the issue of creating a menu for content of each group? If not, this is how I handled it for a proof of concept I was working on to create a series of mini-sites using D7 and OG (I have enabled Organic Groups, Organic groups context, Organic groups UI):

I followed the readme.txt in Organic Groups and created a content type for Groups and a content type for Group Content. I used views to create a page to list my groups which was simple enough. The trick now was to figure out how to create a list of links for the "Group Content" within a "Group".

To create a menu that listed out the group content of a group, I've gone into Structure -> Views and activated the "OG content" view. You can clone it or do whatever but I used the original and edited it. I added a block so that I could place it somewhere in a page region, in this case the left column so that it acted as a sub-navigation then I made two edits:

1) I edited (overrode) the Contextual Filter and changed "When the filter value is NOT available" to Provide default value and that value = "current group from context"

2) I changed (overrode) the format to show fields and added the title field that link to its content (node).

I could take this further and fine tune it but this is the basics of what I found to do the job. I hope it helps.

Andrew

jastraat’s picture

Hey Andrew - I actually don't have a problem myself. My solution is working swimmingly :)

I was proposing a solution for someone from earlier in the thread. The 'menu' for each group is just a view of flagged content that takes a contextual argument of the current group.

awasson’s picture

Sorry jastraat, when I was looking at this earlier I could have sworn you had started this thread but now I see it was mlconnor. I think it's because the comment form puts the latest person's name in the revision line. Now it shows me as the person who did the latest revision.

So your probably doing the same sort of thing I am but you've got the addition the flag to have the link present or not. That adds some more flexibility to it. nice!

bryancasler’s picture

I have manage a site that was built for a national organization. They have state chapters. Each chapter is an organic group. For the menu you could create a view that last out node titles of specific content types. This way each OG can collectively build their groups menu. Then on those children pages, we list out the parent OG's menu. If you wanted to point to an existing page you could integrate this module into the above solution http://drupal.org/project/field_redirection

Live Example: http://ivaw.org/operation-recovery

It's not perfect, but it's decentralized, collectively managed and it works.

Anonymous’s picture

Hi,

Depending on your precise requirements, this may be achievable simply using Organic Groups.

Let's assume you want to create an article and make it visible and accessible only to Group Y (though you can use the same process for any content type and multiple groups).

I assume you know how to create groups as a content type and create group content type. If not, see lewistechwebdesign's super video at http://www.youtube.com/watch?v=CqMEY6WMmtE (you don't necessarily need to use Panels, as he does, but may wish to.) You'll need to know this for steps 1 and 2.

Here are the steps (I'm using Administration menu):

1. In Add content > Group, create Group Y and any others you want.

2. In Structure > Context types > Article, make articles a group content type.

3. In Structure > Menus > Add menu, create a new menu called 'Group menu'.

4. In Structure > Blocks, add Group menu to a region, e.g. Sidebar first.

5. In Structure > Context types > Article > Menu settings, add Group menu as one of the available menus for articles.

6. In Configuration > Organic Groups > Organic Groups field settings, add the Bundle 'Article' and associated fields 'Group visibility' and 'Group content visibility'.

7. In Add Content > Article, you will now see the option to select Group Y (and any others) under Groups audience and 'Private - accessible only to group members' under both Group visibility and Group content visibility. Under Menu Settings you can also check 'Provide a menu link' and select Group menu.

If you now set up different users with memberships of different groups, they should only see Group menu links relating to their groups. Users who are not members of any group will not see the Group menu block at all, because it's empty for them.

You should possibly bear in mind any ways in which restricted content might become partially visible to non-members via things like the Search or Sitemaps - I don't know if this method protects the content fully from indexing by default.

Hope this is helpful and meets your need. If it does, please feel free to donate your $20 to a good charity (in the Drupal spirit!).

Kind regards.

Andrew

kclarkson’s picture

To all,

I have an event site where each event is an OG node type. I also have different content types that are OG posts, (sessions, news etc). To list these OG sessions and news I am using views with an argument for the group along with panels to show all related content.

I really like Jastraat's and Awasson's solution of using views and the flag module to create Menu items within the group. The advantage of using views is that you do not have to create tons of menus as they are automatically populated, with a simple flag click.

The problem I am running into is that I would like to have those views of OG posts as different menus. How can I incorporate links to these views ?

Is there something that I am forgetting?

pontus_nilsson’s picture

The OG Menu module has a D7 candidate now.

jastraat’s picture

Unfortunately, you can't flag a view. The way I got around this was to create a content type specifically for displaying embedded views. (Panels layout - with custom visibility settings - node content pane on top of the view pane). There are so many advantages to this method that we've started using it outside of the pure OG context as well. We can now allow content creators to create new 'view pages'. They pick what kind of view they want to display, they can title it, give it a custom description, a custom path, and pick what terms they want to pass as arguments to limit the results. And then it can be flagged. Glorious. :)

kclarkson’s picture

@jastraat

Could you provide a numbered list of your configurations and modules used ?

I just want to make sure that we are on the same page. I think if we get a nice detailed list together maybe we can get it into the next OG release.

In my opinion this is HUGE because it allows argumented views to be part of the menus and make the whole menu system automated so that our clients don't have to think.

Which makes me :O)

jsimonis’s picture

What I did was create a menu that is used just within the groups. Each of the groups are an item on that menu, with their content that I want in the menu as children to those menu items.

So, for example:

Group 1
> Best video ever
> Cat video
> Funny cat video
Group 2
> Top Billboard songs
> Top VH1 videos

I then installed menu block and set the block to show only on the group pages. I set the depth accordingly so that the only menu items that show on each group are the items that I have set as child items for that group's part of the menu. Fairly easy to maintain and I can choose to add outside links, links to other parts of the site, etc. if I want.

So whenever I am inside Group 1, I see a menu that only shows:
> Best video ever
> Cat video
> Funny cat video

kclarkson’s picture

@jsimonis

Thanks for your input that sounds interesting, but I am going to wait on @jastraat configuration. IMO her configuration is the best solution because it will allow for views and will be very easy for the client to just click the flag link to be added to the menu. Also all the menus will be automated and only one view has to be created.

awasson’s picture

Hey guys,
I'm still picking away at this... I think I'll try the Dev of OG Menus and see how that works but in the meantime, is anyone using the method I described where I activate and modify the "OG content" view and use it as a sub-nav menu?

I only ask as it seems to work quite well in that it automatically adds a new "link" to the "OG content" view whenever you create an OG content page. I'm pretty happy with it however I'd like to add a link to the top sub-nav that leads to the OG that the content belongs to.

Thanks,
Andrew

EDIT: OK, I am stoked about the change I just made to my "OG Content" view. I now have a sub navigation block that starts with a link to the top level group or "Group Audience" and then lists out the Group Content pages.

1) So I began with modifying my the "OG Content" view that comes with Organic Groups as follows:

a) I followed the readme.txt in Organic Groups and created a content type for Groups and a content type for Group Content. I used views to create a page to list my groups which was simple enough. The trick now was to figure out how to create a list of links for the "Group Content" within a "Group".

b) To create a menu that listed out the group content of a group, I've gone into Structure -> Views and activated the "OG content" view. You can clone it or do whatever but I used the original and edited it. I added a block so that I could place it somewhere in a page region, in this case the left column so that it acted as a sub-navigation then I made two edits:

c) I edited (overrode) the Contextual Filter and changed "When the filter value is NOT available" to Provide default value and that value = "current group from context"

d) I changed (overrode) the format to show fields and added the "Content Title" field that links to its content (node).

* To control the order of the links within the block, you can add a numeric dropdown (weight) field to your Group Content and then adjust the view to order the links based on the weight field you just added.

2) Then (wow Views 7.x-3.0 are amazing....) I added the field "Field: Groups audience" and set it to "Exclude from display". Then I added a header as "Global: Text area" and used the "Use replacement tokens from the first row" and placed "[group_audience]" in my header.

Now whenever I am in a group, I get a list of links with all of my content pages and the main page at the top.

I hope this helps someone else who is trying to create a sub navigation block for their Organic Groups but wants to avoid adding too many additional helper modules.

amitaibu’s picture

Title: Organic Groups Menu in Drupal 7 ($20 bounty) » Organic Groups Menu in Drupal 7

Removing the 20$ bounty, it is silly

jastraat’s picture

@kclarkson
Have a content type called "list" (or whatever) with the following fields: taxonomy term reference, select field (for what pane to embed), and description.

To accomplish the embedded views, we're using the following modules:
1) ctools
2) panels
3) views

(All of which are probably on most OG sites.)

You need some way of allowing the end user to choose what view to embed within a given node. One solution we used temporarily was the ctools plugin I submitted here: http://drupal.org/node/1189536 for checking field value. (The select field listed the views we wanted to expose then panels checked the field's value to decide what panel variant to display.)

This worked, but we're using a better way now that involves a custom module my colleague wrote to generate a list of panel panes marked as being "listable" (custom setting). The listable panes are used as the options for the select field - with a custom ctools visibility rule. When the list type field in a content type matches that of the visibility rule, the pane is displayed. (It's useful outside of just the views context - we're using it for embedding info from a web service too.)

We're using a common tag vocabulary across content types. This allows us to pass the terms selected in the list type as parameters to the views coming from the panels display so that content creators can create semi-custom lists of tagged content.

jgraham’s picture

Seems to me that this should be "closed (won't fix)" as http://drupal.org/project/og_menu already accomplishes this. The only thing missing is a stable 2.x release, however the 7.x-2.x-dev version seems to be working just fine for me.

mattcase’s picture

It could be because I'm new to Drupal. I'm trying to do the same thing kclarkson for my clubs/organizations. I can't seem to be able to get a menu on the for the OG that displays multiple content types available for that group. Any help would be greatly appreciated.

joelpittet’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Drupal 7 reached end-of-life and the D7 version of Organic Groups is no longer being developed. To keep the issue queue focused on supported versions, we’re closing older D7 issues. If you still have questions about using Organic Groups on Drupal 7, feel free to ask. While we won’t fix D7 bugs anymore, we’re happy to offer guidance to help you move forward. You can do so by opening (or reopening) a D7 issue, or by reaching out in the #og channel on Drupal Slack.

If this issue is still relevant for Drupal 10+, please open a follow-up issue or merge request with proposed changes. Contributions are always welcome! 💙

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.