Group context in the breadcrumb is lost on some special node tabs such as Votes on Polls, and Revisions on wikis.

Comments

lightsurge’s picture

A similar thing happens with node hierarchy #1297918: Fixing breadcrumbs on node/%nid/... pages who solved it with a _preprocess_page function

mstef’s picture

As of now, we force-override breadcrumbs in all conditions that we see necessary, since there currently isn't a better way to handle breadcrumbs in drupal (to the best of my knowledge). There's also the issue of deciding exactly what should show up where, since when you're dealing with groups, and content in groups, there is a lot that could potentially be in the breadcrumbs.

See commons_core_set_breadcrumb().

It would be helpful if we started a list of pages that need better breadcrumbs, and what we think they should be.

mstef’s picture

Title: group context is lost in some node tabs » Group trail in breadcrumbs is lost on some pages/tabs

Rewriting title, since actual group "context" refers to something else, more critical.

lightsurge’s picture

In that case possibly #1287760: when in a group, and travelling to a node from a content type tab, content type should be in breadcrumb as well as node could be composited with this issue and that one closed...

I had a look at commons_core_set_breadcrumb() but still couldn't see an easy way to add a link to a content type's group content view... I ended up with a hackish solution that simply makes blind assumptions and checks that in the end it has a valid url.

if(arg(0) == 'node' && is_numeric(arg(1))) {
$node = node_load(arg(1));
if ($node->type != 'group') {
$group = og_get_group_context();
$type = node_get_types('name', $node);
$path = 'node/' . $group->nid . '/content/' . $node->type . 's';
if (menu_valid_path(array('link_path' => $path))) {
$breadcrumb[] = l($type . 's', $path);
}
}
}

I'd put this in template.php as I wasn't aware of commons_core_set_breadcrumb()

Anyway, that's one item I would expect to see in node breadcrumb trails. Other than that we have:

  • Node edit, currently includes the node title, which seems unnecessary (we don't have it in 'View')
  • Node revisions, currently Home->Node_Title. Think this should be Home>Groups>Group_name>Node_type
  • Votes (polls), the results tab is fine, but the votes tab is as with node revisions
  • Track, as above
lsolesen’s picture

Version: » 6.x-2.x-dev
Issue summary: View changes