Hello,

This module does not work for me at the moment.

I notice it uses menu_get_object(taxonomy_term... but according to the API it only works for taxonomy_vocabulary
http://api.drupal.org/api/drupal/includes!menu.inc/function/menu_get_obj...

arg(2) may be a better bet for getting taxonomy term id.

Comments

xjkwak’s picture

It works for me (D7):

$term = menu_get_object('taxonomy_term',2);
lazysoundsystem’s picture

I was also having trouble with this - it turns out that it does work with D7, but it doesn't work if you have Views enabled.

Views defines its own callback for the taxonomy path taxonomy/term/% (instead of taxonomy/term/%taxonomy_term), so there is no load_function for taxonomy terms.

This is the case whether the 'Taxonomy term' view is enabled or not.

lmeurs’s picture

#1 works for me on Drupal 7.22 and Views 7.x-3.7, with the Taxonomy term view enabled or disabled.

EDIT:
Nope, I have to stand corrected. The Views module seemed to not rebuild the menu cache after enabling (or disabling) the taxonomy/term/% view, so the load function callback still was taxonomy_term_load. After manually clearing the menu cache the load function callback became views_arg_load.

My conclusion so far: after enabling the taxonomy/term/% view and clearing the menu cache, I could not get menu_get_item() to load the current taxonomy term.

spearhead93’s picture

Actually, if you enable the views based taxonomy page, the way to get the term tid is:
menu_get_object('views_arg', 2)

katharine_gates’s picture

Issue summary: View changes

Hi and thank you for this lovely and elegant module!

However my breadcrumbs are displaying strangely, with duplicates in the nesting terms, i.e.

Home › FREAKS › Unusual Size › FREAKS › Unusual Size › Giants

I am using Views-based taxonomy pages along with Taxonomy menu, perhaps this is the problem. Or if that is not the problem where do I put spearhead's code?

Any ideas?

Thank you.