Additional views filter for OG
sirkitree - April 22, 2009 - 23:03
| Project: | Activity |
| Version: | 6.x-2.x-dev |
| Component: | User interface |
| Category: | task |
| Priority: | normal |
| Assigned: | sirkitree |
| Status: | active |
Description
This should allow us to filter activity by group, showing you any activity in the groups that you belong to OR specify in an argument.
OG is the group solution of choice, so we need a views filter for this.
Views filters are now created automagically by any module who implements our hook_activity_access_grants() (@see DEVELOPER.txt for more information). So, let's come up with a patch against the latest OG implementation and submit it to them after we get it worked out here.

#1
#2
#3
I'd love to support activity. I'll take a look at any patches that arise here.
#4
Im digging through the module at the moment working on this feature. I will post any headway I make.
#5
subscribing.
#6
Isn't it very easy with Views? You simply define a relationship between activity and organic groups tables.
Something like this:
function YOURMODULE_views_data_alter(&$data) {$data['activity']['nid'] = array(
'group' => t('Organic groups'),
'title' => t('OG to activities'),
'help' => t('Attach Organic Group to activities.'),
'relationship' => array(
'handler' => 'views_handler_relationship',
'base' => 'og_ancestry',
'field' => 'group_nid',
'label' => t('OG to activities'),
),
);
}
#7
But what if you want to display group activity on user/14/activity. something like
There is a whole access implementation to facilitate this. Lot more then building a relationship.
Read the Developers.txt and related discussion: http://groups.drupal.org/node/21033
The api has changed since then, but there is a good discussion on the motivations for the system.
#8
subscribe
#9
subscribe
#10
Would this be adding a filter to a view that allows you to show content types for that og ?
I have a situation now where I'm trying to just list content types for a og, and I have "Organic groups: OG: Posts in current group = " though I can't add TRUE to the end of that.
Is this additional view what I'm talking about and need ?
#11
@JerryH: that sounds correct. However OG will still have to know if an activity is within a group
@Scott Reynolds: can we share here what we have for community.module as to how it handles this and then maybe someone can work on an og implementation?
#12
In my case all the content types are create inside a group (as I understand how OG works).
Were this SQL-ish I'd use "SELECT content_type FROM moo WHERE type=(the types I want) AND group_id=(the group context were in)";
Though I'm learning views & groups atm so thinking there might be another way of doing it as I've just watched webchick do something like it with the 48 hour basecamp build here : http://www.doitwithdrupal.com/free-videos
The highlighted bit is from a D5 og& views build that I'm trying to replicated (it's a site rebuild into D6).
#13
Well so far I've found these :
http://drupal.org/node/66145
http://groups.drupal.org/node/13428
http://drupal.org/node/213448
And it looks like this would do what I want, though it's not for D6 is seems :(
http://groups.drupal.org/node/10445
#14
Have part hacked this in for now, storing the last group viewed in the session.
Then have added a filter "OG Post in current group"
#15
subscribe
#16
subscribe
#17
subscribe
#18
subscribe