Would like to combine Primary Term and Taxonomy Breadcrumb

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
Katrina B's picture

I am building a website in ProsePoint for a small daily newspaper. The stories will likely be linked to more than one taxonomy term, but I would like to be able to use breadcrumbs to point users back along the path of one term for each story.

If I use Taxonomy Breadcrumb by itself, it doesn't always choose the term that I would like. I can use Primary Term and Custom Breadcrumb to set up a breadcrumb trail with just one term (the Primary Term), but I want the entire breadcrumb trail, the way it's displayed in Taxonomy Breadcrumb.

I'm not fluent in PHP at all, though I have made some small changes when I have been able to find step-by-step directions on how to do something (such as creating a .tpl.php file to make changes to a single CCK field).

Can anyone help me to combine (somehow) the functionality of Primary Term and Taxonomy Breadcrumb to get the result I want?

Comments

The Pathauto module might

kevinkpierce's picture

The Pathauto module might help. This Mustardseed video is a good intro: http://mustardseedmedia.com/podcast/episode18

I have Pathauto installed

Katrina B's picture

I have Pathauto installed; it's working just fine on URL aliases. Does it have a Breadcrumb feature I'm not aware of?

Katrina
Site builder, writer, trainer, graphic designer

Check this out

Actually ...

Katrina B's picture

Actually, the tech lead assigned to my project was able to write a solution for me by modifying the Taxonomy Breadcrumb module to read the Primary Term as the "lightest" term ... and that works just fine.

Katrina
Site builder, writer, trainer, graphic designer

Possible code modification

greggmarshall's picture

I ended up doing a similar modification, it wasn't too bad.

In taxonomy_breadcrumb.inc file at line 47, right after the definition of the function _taxonomy_breadcrumb_node_get_lightest_term, I added this bit of code:

  // Return the Primary Term module's primary term instead of the lightest term.
  if (module_exists('primary_term')) {
    return taxonomy_get_term(primary_term_get_term($node->vid));
  }
  // Original Taxonomy Breadcrumb code in case the Primary Term module isn't enabled.
sethcohn's picture

Needed this functionality, and no combo of modules seems to generate the correct results, so I'll be cloning bits of Taxonomy Breadcrumb to add it directly to PT.

See http://drupal.org/node/801196 for status

Taxonomy

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week