function taxonomy_term_path($term)
$items[] = array('path' => 'taxonomy/term'
displays a "taxonomy term" element in breadcrumbs. Remove the element from breadcrumbs by changing 'type' => MENU_CALLBACK to 'type' => 0 or equivalent. Perhaps make it an administration setting or something that can be set from other modules including taxonomy_menu.

I have looked at turning off the menu element but it is used in various Drupal modules. The simplest approach seems to be to leave the element there and not display it in breadcrumbs.

petermoulding.com/web_architect

Comments

magico’s picture

Version: 4.7.4 » 6.x-dev

What is the reason for this feature?

(note: features will be added in most recent branch)

peterx’s picture

When I expect a path of:
home > technology > apache
I get:
home > taxonomy term >technology > apache
The patch is to remove the "taxonomy term" from the path.

The error occurs when using with taxonomy_menu with taxonomy. I did not investigate the right way to fix the path, I just went looking for the first way that works. I did not look into why you would want the code inserting "taxonomy term" into the breadcrumb.

petermoulding.com/web_architect

peterx’s picture

Version: 6.x-dev » 5.0

I upgraded to Drupal 5.0 and the problem is the same, there is the unwanted string "Taxonomy Term" in the middle of an otherwise perfect breadcrumb. This time changing the menu setting does not fix the problem.

peterx’s picture

Title: function taxonomy_term_path($term) $items[] = array('path' => 'taxonomy/term' remove breadcrumb display » Breadcrumb contains "Home > Taxonomy Term > xx" instead of "Home > xx"

I changed the heading to make it meaningful. I am using the production Drupal 5.0 with the latest Pathauto etc.

peterx’s picture

I did not find the cause so I added code to page.tpl.php to remove the string. Before printing the breadcrumb, I inserted code to remove the first occurence of "taxonomy term".

			$breadcrumb_parts = explode(' » ', $breadcrumb);
			if(stripos($breadcrumb_parts[1], 'taxonomy term'))
				{
				unset($breadcrumb_parts[1]);
				$breadcrumb = implode(' » ', $breadcrumb_parts);
				}
			print $breadcrumb;

petermoulding.com/web_architect

gaborh’s picture

Hi,

I think this would be more correct:

            $breadcrumb_parts = explode(' » ', $breadcrumb);
            if(stripos($breadcrumb_parts[1], 'taxonomy term') !== false)
                {
                unset($breadcrumb_parts[1]);
                $breadcrumb = implode(' » ', $breadcrumb_parts);
                }
            print $breadcrumb;

Notice the !== false in the condition.
More info: http://php.net/function.stripos

Without this addition the breadcrumb was not always displayed correctly on my pages (depending on the number of elements in the breadcrumb).

goose2000’s picture

Title: Breadcrumb contains "Home > Taxonomy Term > xx" instead of "Home > xx" » Breadcrumb contains "Home > Taxonomy Term > xx" instead of "Home > xx"

What is this strange character:

' » '

in the code example above?

as in .... $breadcrumb_parts = explode(' » ', $breadcrumb);

dpearcefl’s picture

Status: Active » Closed (won't fix)

Considering that no new features will be added to D5 and that no one has shown any interest in this issue for a long time, I am closing this issue ticket. If you think we still need this feature request, please reopen it and move it to the D8 issue queue.