in trying to get http://drupal.org/node/96971 working ("make better use of tabs and subtabs on project nodes") i ran into all sorts of problems trying to get tabs and breadcrumbs to interact nicely with each other. eaton and morbus pointed me to drupal_set_breadcrumb() which works much better. ;) to avoid hurting myself in other places, i'm planning to remove the few uses of menu_set_location() and convert everything to use drupal_set_breadcrumb. sadly, the format of the arrays they expect is different, which is why i'm just converting everything and keeping things consistent.

also, l() does the check_plain() on the title of the link for us, so fear not the raw usage of $node->title, etc.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dww’s picture

after further digging into project's use of breadcrumbs, and reading the (rather ingenious, but somewhat depressing) http://www.angrydonuts.com/menu_set_location_can_eat_my_sho [rts!], i've improved upon my previous attempt.

this time, if the site has specifically hijacked /project into the menu tree and given it another name (like d.o does by making it a primary link called "Downloads") we actually honor that everywhere. ;) furthermore, it's silly to have project_project_set_breadcrumb() return a breadcrumb array, even though the name says "set". now, that function is responsible for calling drupal_set_breadcrumb() and it simplifies all the call sites. furthermore, there's no reason for that function to take a reference to $node (since it's not trying to change anything about $node), and in fact, $node should be an optional arg, anyway, so we can reuse all this code even when we're not looking specifically at a project node (e.g. in all the project browsing pages).

dww’s picture

Status: Needs review » Fixed

after reviews eaton and others, committed to DRUPAL-4-7--2, installed on d.o, and backported to DRUPAL-4-7.

Anonymous’s picture

Status: Fixed » Closed (fixed)