When building a view to show content that applies to a user, it's often helpful to filter that content with the "Organic Groups: Groups" filter. By exposing this filter to the user, the user can choose the groups that interest them. Unfortunately, the exposed filter currently includes ALL groups on the entire site, not just the ones the user is a member of. It would awesome to have an option to reduce the list of group in the exposed filter to include the groups that the user is a member of only. This patch extends the existing group_nid filter handler to add this functionality. See screenshot.
Comment | File | Size | Author |
---|---|---|---|
og-filter.png | 126.31 KB | quicksketch | |
og_views_limit_groups_filter.patch | 1.84 KB | quicksketch | |
Comments
Comment #1
d0ublej0 CreditAttribution: d0ublej0 commentedThank you! The filter works great!
Comment #2
Grayside CreditAttribution: Grayside commented1. Add relationship for group node of post.
2. Add argument for member of group with that relationship, defaulted to current user.
Comment #3
jvieille CreditAttribution: jvieille commentedI have exactly the reverse problem: the filter only shows the groups the user is member of, which is not correct as this prevents to query unrestricted nodes of these groups.
Actually, I get an "illegal choice" error for non admin users as the filter is set to select all groups by default
Basically, it seems that OG does what quicksketch is asking for : restricting the user to select groups he is not member of in views exposed filters - which is not an expected default behavior.
In og_module for function og_all_groups_options(), it is stated
But I am not sure it is the case, I do not see any user restriction in this function.
Is there something wrong in my site, or is this really an intentionnaly designed béhaviour?
Thanks for help
Comment #4
kim-odisee CreditAttribution: kim-odisee commentedIs this available in og-7.x-2.x?