2

I have content types that use taxonomy to categorize content. The Pathauto url alias structure is 'content type' / 'taxonomy term' For example:

Food/japanese - where food is the content type and japanese categorizes it.

I am using Custom breadcrumbs with great success except for when viewing a taxonomy page at it's alias. breadcrumbs don't work at all. The term does not show up, the parent does not show up, nothing happens. I have the 'custom breadcrumbs taxonomy' module enabled.

I saw that enabling that sub module created a place where I could create a custom path for each term. Technically I could go through and create a path, but I have 100s, if not over 1000 different terms and more added all the time. It would not be possible to use the term.

This would be very easy if I could just specify 'content type' / 'term' like I do for Path auto. One entry could take care of every situation. Is this possible? anyone know how I can configure this correctly?

2 Answers 2

3

I ran into a similar issue in D7 and opted to use Easy Breadcrumb: http://drupal.org/project/easy_breadcrumb.

Easy Breadcrumb compiles the breadcrumb from the URL, and is simple to set up. But it seems like it should work in yours.

Here is an example of how it works:

  • URL: www.example.com/portfolio/french
  • Breadcrumb: Home › Portfolio › French

What is wonderful about Easy Breadcrumb is that it doesn't matter whether you are using content types, taxonomies, views, or whatever, because it only looks at the URL. Because it relies strictly upon the URL, however, it won't be appropriate in many cases.

I wasn't comfortable with how it handled searches (Home › Search › Content › [Search term]) and recently messaged the maintainer about the possibility of being able to list instances in which Easy Breadcrumb would be omitted, and he obliged in the latest release.

1
  • The code in that module inspired a theme function to use the url structure as the taxonomy structure. Because my urls are 'hackable' this works great! Thanks for the direction.
    – blue928
    Commented Jul 29, 2012 at 21:09
3

Not sure if this is the best solution, but you can do that always with theme_breadcrumb() function in your theme like this:

function YOUR_THEME_breadcrumb($vars) {
    $breadcrumb = $vars['breadcrumb'];
    if (count($breadcrumb)) {
        if (arg(0)=='taxonomy' && arg(1)=='term') {
            $term = taxonomy_term_load(arg(2));
            if ($term->vid==YOUR_VOCABULARY_VID) {
                $breadcrumb[] = l('Your landing page', 'landing-page-url');
            }
        }
        return '<ul><li>'.implode('<span class="separator">&raquo;</span></li><li>', $breadcrumb).'</li></ul>';
    }
}

I'm assuming you're using D7.

1
  • I found that doing this was sufficient for my purposes. I tried Hansel and it was far too convoluted.
    – Hawkee
    Commented Jan 28, 2016 at 2:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.