When using pathauto to automatically create intelligable paths for items based on their title and taxonomy it would be desirable for the taxonomy menu to use the same pathing for the links it generates.

CommentFileSizeAuthor
#5 taxonomy_menu.module.patch6.68 KBstmh

Comments

radbrad’s picture

Is it not possible to do a drupal_get_path_alias before rendering the taxonomy_menu? so that if there is an alias for a path to a node, then taxonomy menu will use that rather then taxonomy_menu/x/y

obviously a pre-requisite would be that taxonomy_menu checks is path.module is enabled, and would need some awareness of path_auto too (for indexes etc.)

dkruglyak’s picture

Component: User interface » Code
Category: feature » bug

I think radbrad is suggesting the right approach.

I am marking this as a bug vs. feature request, since lack of this fix creates duplicate category pages and confuses navigation. One if navigated through taxonomy_menu, another when opening category directly. The latter does not show expanded menu.

dkruglyak’s picture

on a separate note, the menu should expand itself to the right depth when a corresponding category page is open, whether it is open from the menu or anywhere else

rcross’s picture

Hi, i've been having the same issue, so I posted a request over at pathauto (http://drupal.org/node/37788) with a link back here so lets hopefully see some collaboration.

Thanks!

stmh’s picture

Status: Active » Needs review
StatusFileSize
new6.68 KB

Ok, here's a patch for the taxonomy_menu-module. It needs pathauto, but doesn't use pathautos generated aliases. (Because this is not possible with the current implementation of the menu-system)

Currently taxonomy_menu builds the menu-paths (which are also the links) out of taxonomy_menu/voc-id/term-id, my approach is to use the names of vocs/terms, so taxonomy_menu/voc-id/term-id gets to voc-name/term-name/subterm-name. Thanks to the nice menu-system of drupal this approach works like a charm. taxonomy_menu needs pathauto only to create 'clean' variations out of the names of vocs and terms. It doesn't use the specified aliasses. To 'transport' the ids of vocs and terms to hook_page I am using menu-callback-parameters.

This works for me, I hope it works for you, too.

I hope I coded it the right way, (I'm still a drupal-newbie). You have a new setting under /admin/settings/taxonomy_menu to switch this new behaviour on, and it checks the existance of the pathauto_module. So the old behaviour is still there if needed/wanted and it should not break existing drupal-installations.

There is one problem with the menu-module though, after switching the aliasing on you have to reset the menu, if you get duplicate entries of the taxonomy_menu-entries.

This patch is against drupal 4.6.3 (and it's my first, so be nice with me ;)

moshe weitzman’s picture

Status: Needs review » Closed (duplicate)

a better approach is to use the hook provided by pathauto.module. there is an issue in this taxonomy_menu queue which implements this

Bevan’s picture

As a temporary solution, I've modified my htaccess file. It is ideally used in conjunction with global redirect. It doesn't have any extra redirects other than what global-redirect already causes. http://drupal.org/node/121513#comment-215538

jiangxijay’s picture

Subscribe.