Upon reflection, I'm going to say that I think taxonomy_menu.module is outdated in the way it handles creating and coordinating taxonomy menus.

It is set up to redirect the path to any given menu item through itself, hence the "taxonomy_menu" urls when clicking a menu item. I believe this is how it had to be done before the new menu system existed. But now, it creates an extra level of complexity. (If there is another reason why urls are redirected through the module itself that I am missing, please let me know. But I can't see any...)

I'm thinking taxonomy_menu.module should be rewritten, or a new one created, that merely does the setup, and maybe hierarchy management, of a given vocabulary.

The admin settings could be the same as are currently offered. You can choose which Vocabularies to create menus for, and you can choose to 'Allow descendants' or not. But the new module would merely insert the correct paths (using the default Drupal taxonomy urls) for each taxonomy term. For parent terms (in hierarchical taxonomies), the module would build the correct paths using the ',' or '+' operators, and insert those.

The admin settings could also have an option to rebuild the taxonomy menus. Therefore, if you add some taxonomy terms, you could click the 'Rebuild' button, and the module would parse the current menu, compare it to the vocabulary, and add or alter and changed terms. (I'm not sure how the current module handles the situation of added or altered taxonomy terms.)

Anyway, maybe I'll take a crack at this soon, but I'm afraid the needed logic (to build the paths, etc) may be out of my league. I thought I'd put it out there for the module maintainers though.

Comments

joshuajabbour’s picture

One more benefit: if you've setup url aliases for your taxonomy terms (like I have), then browsing those terms through the taxonomy menus would use the aliases. This saves you from creating two aliases for each taxonomy term! Simplicity realized.

*note to self: create batch url alias addition module, to make adding aliases for taxonomies, etc much easier!...

Anonymous’s picture

I second this. As you said, if one takes the time to create customs aliases for taxonomy terms, having taxonomy_menu changing the urls yet again is extremely unwanted. I really hope this gets improved soon, since I really need to use taxonomy_menu to have a properly functioning breadcumb, but its unwanted url system discourages me. :(

ñull’s picture

Title: Change way module paths work for new menu system. » Taxonomy menu with consistent URL's

I agree with you all.

Recently some patch was added to the HEAD of this module to display the taxonomy description. A nice hack, because I need it, but it only addresses a symptom, not the cause. Another symptom illustrates what I mean: the taxonomy images don't appear either when you navigate the taxonomy menu.

This would all work OK when taxonomy_menu would consistently use the "normal" taxonomy URL's.

ñull’s picture

Sorry, it was not my intention to change the title. I thought it would only be the title of my comment. Just change it back when you prefer the original!

devinhedge’s picture

Would the same menu system being used for the project.module work with a little modification? It uses taxonomy terms starting with a base of /projects. Instead the "base" would come from the configuration like it currently does.

jonbob’s picture

Here are the reasons things are the way they are:

1) Yes, this module does predate the menu administration module.

2) In order for hook_menu() to declare menu items in a hierarchy, the path must reflect the hierarchy. Taxonomy_menu paths do this, but regular taxonomy paths do not.

3) The suggestion given here would require the module to directly manipulate the menu table, as there is no API for doing so at this point.

4) As noted, changes to the vocabulary structure would require a resynchronization, which I think is confusing unless it can be done automatically. Currently the module handles this transparently.

5) I'm always short on time :-)

edrex’s picture

Version: » 5.x-1.x-dev

I would like to tackle this. I've already done several throwaway implementations in the past. I've come around to using taxonomy in a major way for several projects, and navigation is the final missing piece for me.

The module should simply synchronize menu aliases with taxonomy structure using hook_taxonomy: http://api.drupal.org/api/5/function/hook_taxonomy . Since there is no place currently to store the "ownership" of each menu alias (ie, which module is managing the alias), we can introduce a table with two columns, a menu ID and a "realm" (ie "taxonomy_menu"). Other modules could tie into this.

Of course, Drupal 6 menu system will be a totally new product, so this work may be Drupal 5 throwaway, but damnit, all my sites ATM are D5! Comments/suggestions welcome. JonBob, I'd like this to remain under the taxonomy_menu name, under a new dev branch, with an upgrade path (with your blessing).
-- Eric

edrex’s picture

category_menu is very similar this concept, although the code is rather long-winded. A good reference.
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/category/cate...

edrex’s picture

Another approach would be to extend pathauto to autogen menu aliases at the same time. This could follow identical structure to path aliases. This could work everywhere, not just with taxonomy, to unify menu structure with url structure. Thoughts?

izaak’s picture

Aliasing the taxonomy_menu paths will work, however there will be no active trail in taxonomy_menu menus. This is a problem for my own needs. Any way of getting around that?

izaak’s picture

In order for pathauto to synchronise taxonomy aliases from taxonomy_menu URLs, I think we would need to add a new substitution variable for a numeric category path. I'm not ready to dig into that until I can think of a way to get menu trails working... Otherwise, I think it might be better to just make taxonomy_menu more flexible (ie specifying your own callback). What are some sane settings to add?

Damjan Dvorsek’s picture

Hi,
I have recently posted a request for "Internationalizationa of menus using "taxonomy menu"" at i18n modul page.
http://drupal.org/node/160397

What I want is, if I'm at certain position in the menu of the first language, I can jump to the coresponding position ( 1 to 1 corespondence between translated terms of vocabulary) in the menu of the second language by switching the language. As far as I understand to make this hapen I would need consistent taxsonomy URL-s.

So my question is, wether there is any dev version of taxonomy menu module which has this issue fixed or what is the current status of it.

arlinsandbulte’s picture

Status: Active » Closed (fixed)

This is quite old and outdated....
I think many of the suggestions here have actually been implemented.

I am going to throw this straight into the 'closed' category.
Feel free to re-open if you disagree.