In Commons 2.0 (GA), I have created some groups, such that Group 1, Group 2, Group3, and Group 4. Each group has some subgroups, such that Group 1, Sub 1, Sub 2, Sub 3, | Group 2, Sub 1, Sub 2, Sub 3 | etc.

When I click on Group 2, the breadcrumb that is displayed is "Home >> Groups >> Group 1 >> Sub 1 >> Sub 2 >> Sub 3 >> Group 2.

However, Sub 1 and Sub 2 (etc.) do not have any Sub-groups (though they will shortly, which will send my Breadcrumbs to three or four lines by the time I get to "Group 4, Sub 7" (for example).

You can see it here http://bit.ly/oCvswq

where "Ireland R... O.." is the main Parent Group, Conn... is a sub-group of this, and Lein... is also a subgroup of Ireland R... O..

The groups between Conn.. and Lein... in the breadcrumbs are subgroups of Conn...

Comments

lightsurge’s picture

Initially I wasn't seeing this on the latest Commons dev, but I wasn't seeing group hierarchy in breadcrumbs at all.

But then I realised that this related to the subgroups view groups/sub/% which doesn't seem to be in any sort of use in Commons 2.x dev

Anyway, the problem seems to arise because we call og_subgroups_get_group_tree() in commons_subgroups.module which will 'return the entire hierarchy that the group is a part of' therefore including everything below the hierarchy's furthest ancestor, including a group's brothers/sisters, their children and their children's children etc etc.

So we need to fish out what we don't want from og_subgroups_get_group_tree() before we call og_subgroups_flatten_tree().

markconroy’s picture

StatusFileSize
new24.64 KB

Has it been fixed? It seems to work much better in 2.3. See attached.
Screenshot

lightsurge’s picture

StatusFileSize
new995 bytes

Or could just do this...

lightsurge’s picture

@Mark C it looks like you're actually in a group content view there rather than in the groups/sub listing view?

commons_core_set_breadcrumb() which controls the group content view breadcrumbs currently only sets a very basic breadcrumb in group content views, which is Home > Groups > Group_name

Meaning only the 'current' group name is called, if a group is within the subgroup structure Parent_Group_Name > Subgroup_name, it would only have breadcrumb Home > Groups > Subgroup_name in the group content view.

lightsurge’s picture

Status: Active » Needs review
lightsurge’s picture

StatusFileSize
new1.95 KB

This adds subgroup breadcrumbs to the group content views as well

lightsurge’s picture

StatusFileSize
new3.36 KB

Plus subgroups in breadcrumb for group nodes / og pages.

We could probably add this also for group posts, but since these can be cross-posted, it would be messy.

markconroy’s picture

@lightsurge,

I "kind of" understand you (I'm not a developer), but my group "Portumna" is a sub-group of "Galway" (which is itself a sub-group of "Connaught" which is in turn a sub-group of "Ireland").

This set up suits me perfectly: we don't use the other groups in any manner except as message board parents.

Here's the site
http://bit.ly/rQ4gnl

lightsurge’s picture

@Mark C

My patch would by default change Home>Parishes>Portumna in your case to Home>Parishes>Ireland>Connaught>County Galway>Portumna linking to each breadcrumb item's group homepage. Apart from the 'Parishes' which is an alteration of the default text 'Groups' and thus the confusion, this would seem like expected behaviour for most subgroup uses?

Looking at your site (which looks great btw) users can still navigate to say /group/county-galway via the menu system and view more information about County Galway... the breadcrumb would link to the same info, so is that really a bad thing?

markconroy’s picture

Your approach is correct, it's just that in our case we are organising across the country on a parish-by-parish (for all the commons features) basis and really only have the county (Galway) and province (Connaught) level as Menu parents and also for people to post in the County message boards.

That said, the more I think on it, it is perhaps better for us to follow your approach.

(I guess either way is good for me so.)

Thanks for the compliments.

ezra-g’s picture

Status: Needs review » Needs work
--- a/modules/features/commons_core/commons_core.module
+++ b/modules/features/commons_core/commons_core.module
@@ -674,6 +674,14 @@ function commons_core_set_breadcrumb($path) {
         if ($node = menu_get_object('node')) {
           if (og_is_group_type($node->type)) {
             $breadcrumb[] = l(t('Groups'), 'groups');
+            $group = node_load($path[1]);
+            $tree = og_subgroups_get_group_parents((object) array('nid' => $group->nid));

This will cause a WSOD on sites without og_subgroups/Commons_subgroups enabled.

lsolesen’s picture

Version: » 6.x-2.x-dev
Issue summary: View changes
Status: Needs work » Needs review