Hi,
how can I force this module to use in terms' urls pathauto aliases?
Instead category/1/2/3/... to have food/meat/pork/...
I found #234513: Path Auto Support, but there is solution only for D5, can someone help me with D6?
Thanks for responses
John Z.

CommentFileSizeAuthor
#6 taxonomy_menu_with_pathauto.txt3.1 KBbrainski

Comments

zakjan’s picture

no idea?

yngens’s picture

subscribe

two40’s picture

subscribe.

thanks for a really usefull module

marcob’s picture

subscribe

dbaumeister’s picture

subscribe

Ditto on the thanks for such a great module.

brainski’s picture

StatusFileSize
new3.1 KB

Because of such a big respond to this feature, I created a patch. I tested it with a hierarchical vocabulary and its working fine for me.

Maybe some of you guys can test it too and later it can be committed to head.

The attached patch is for the latest version 6.01.

scottrigby’s picture

Status: Active » Needs work

I applied the patch, but the menu items I already had still didn't respect my pathauto settings.

So i reset the menu (loosing any customizations, and moved the items back to the Navigation menu) and checked the link but it still displays as '/category/3/9/11/14'.

Then I went into taxonomy_menu admin settings and deleted the default 'category' (under the 'Module page' label) to see if that would have any effect. (The three check-boxes below are unchecked btw).
It changes the link to 'http://3/9/11/14', removing not only 'category' but also the base_path from the url, so the site is not found. (So I added 'category' back and the link is back to the way it was at the beginning).

I then changed 'Show this category in menu' to 'No' in taxonomy_menu settings. It removed the menu :) -- But then I added it again, and same problem.

I ran update.php & cleared cached data just for fun.
Re-added the menu is taxonomy_menu settings, and checked -- same issue.

Has this worked for anyone?

Please let me know if I can do anything else to make my tests more meaningful -- or help in any other way.

Cheers :)
Scott

marcob’s picture

Sorry for my bad English.
It works little. It needs the specific path pattern in pathauto, don't work with only default path pattern. The first menu-element need review (it likes hard).
Last, it creates a new alias instead using pathauto alias, and append to it a number (like alias-0). Change 'No'->'Normal'->'No' in 'Show this category in menu' creates a huge number of alias.
It's a great workaround, but I think that the issue is using pathauto already created alias, and not create new alias.
I hope that someone can undestand what I wrote. :)

alex.k’s picture

Subscribing

serg.remote’s picture

subscribing

alliax’s picture

What is this module? How can it be not using pathauto aliases in 2008? Come on guys!

kyutums’s picture

Subscribing

curagea’s picture

subscribing

grendzy’s picture

Thanks for the patch, I think honoring URL aliases is important, whether created by pathauto, manually, or some other module.

I don't really understand the approach taken by this module though. Why does it define a page callback at all? Why not just link to taxonomy/term/42, and let url() handle it?

if (module_exists('pathauto')) seems off track, because it shouldn't matter what module created the alias.

aaronshaf’s picture

subscribing

aflores3’s picture

subscribe

giorgosk’s picture

I agree with grendzy
All you need to do is let l() do the link creation and correct path alias is always up to date

otherwise great module

ikarusweb’s picture

subscribe

ladamiak’s picture

Assigned: Unassigned » ladamiak

Hi folks... I'm just new here, and at drupal too, so I don't now if what I'll say is something stupid but I gave this a try:

In taxonomy_menu.inc, function _taxonomy_menu_node_view, where the $path is defined, I've made this change:

- $path = $old_path .'/'. $term->tid;
+ $path = drupal_get_path_alias('taxonomy/term/'.$term->tid);

Well... it did not render the link for the vocabulary, but did render the right paths for the terms in the menu.
(this menu itens need to be set expanded, since the vocabulary menu is not rendered)

Everything else is broken... like breadcrumbs and parent terms pages.

Can someone more expirienced take a look at this ?

Afief’s picture

ladamiak:

Thanks for trying to fix this long-standing issue, here is basically what needs to be done:
You need to write a hook for taxonomy menu(I think it's called taxonomy_menu_pathauto, see the readme in the pathauto module) which tells pathauto how to replace the links taxonomy_menu creates.

Note that I have no experience in working with Pathauto myself, so I might have missed some important point here, but the readme should have all the info you need.

JubW’s picture

great module but this is a very important feature

fumbling’s picture

Subscribing

Mac Ryan’s picture

Subscribing too.

doudou’s picture

subscribe

fumbling’s picture

I'd agree that the URLs that taxonomy menu comes up with should be the same URLs in place for the taxonomy terms themselves. But what is actually of greater concern to me at the moment is not the URLs but the fact that the taxonomy term-pages are rendered differently. For example, the page www.example.com/topic/4/28 (created by taxonomy menu) does not look the same as its counterpart www.example.com/topics/Obama, although it displays the same content.

It seems that www.example.com/topic/4/28 doesn't hook into the taxonomy term view and as a result looks completely different, using the default styling I suppose, and can't be altered with views from what I can tell. Am I missing something? Hope so, as I can live with the URL being different as long as I can get the page to look the same (automatically or by way of views).

Mark Theunissen’s picture

I'm evaluating this module for quite a large project and this is quite an important issue. As far as I can tell, the way the Taxonomy Menu module currently works is as follows:

  • hook_menu() adds menu items based on vocabulary hierarchy. The root for these items is determined by the value set in the variable 'taxonomy_menu_display_page'. For example, if you've specified "topic", then the menu items have the path /topic/x/y/z.
  • Each menu item uses the same custom page callback function, _taxonomy_menu_page().
  • This page callback is called when a user goes to /topic/x/y/z and decides what to do. If the user has selected "Normal" from the admin page, then _taxonomy_menu_page() will render the page using core Taxonomy module's taxonomy_render_nodes() function. Note that this bypasses all view's settings and causes problems that are mentioned in other issues (you can't use an overridden taxonomy view).
  • If the user had selected 'View' as the output, then the _taxonomy_menu_page() function loads and executes the view manually, passing it the arguments.

My idea for a version 2 of this module is to drop this _taxonomy_menu_page() function altogether, and instead rely on Pathauto and Views properly. So here is an example in the new workflow:

  • When building the menus, go through the taxonomy tree and assume normal core taxonomy base paths of the form /taxonomy/term/%.
  • Before returning the item, check to see if it's got an alias, if so, use the alias instead.
  • Stop this new menu item from 'overriding' the old callback, i.e. so that we don't step on Views or Pathauto's toes ... this where I get a bit vague because I'm not 100% on the Drupal 6 menu system.
  • Now the user can have a menu of the form /1st_level_term/2nd_level_term/3rd_level_term or whatever they like (depending on Pathauto settings), and they can override these as they like using views.

Like I said, I don't know the Drupal 6 menu system as well as I'd like, and this is just a quick wishlist of what I'd like to do. I would love it if someone who knew more about the gotchas and pitfalls could point out if this was a good idea or not!

Thanks!

Mark Theunissen’s picture

Side note: this module is as old as time itself, I notice that the project node id is #3724!

Maybe some of this baggage is carried over from a time when supporting functionality didn't exist in core?

greggles’s picture

There is an older issue with a patch at #192493: Using path aliases with menu paths. Perhaps the work can be merged to find a truly good solution.

Mark Theunissen’s picture

Thanks Greggles. I'll take a look. I'm aware that it's a Drupal 5 patch and of course the menu system underwent a big overhaul, so not sure how appropriate it will be.

diamon’s picture

subscribe

ckidow’s picture

subscribing

indytechcook’s picture

Assigned: ladamiak » indytechcook
Status: Needs work » Postponed

This module is being rewritten to better utilize the D6 menu structure. See issue #304379: mis-use of D6 menu system The Autopath integration will be reviewed then.

Mac Ryan’s picture

While waiting for the 6.x version to be fixed, I found this other module: http://drupal.org/project/taxonomy_navigation which seems to do pretty much what people is looking for, in this thread. Unluckily it is only for D 5.x... :-/

stijn vanhandsaeme’s picture

i'm also very much in need of a solution for this. i'm not much of a coder so i'm afraid i can only help in simple things. can you give us an idea of when this could get solved? (i'll try make translation to dutch soon btw)

indytechcook’s picture

It will be included in the next version. I expect an initial DEV release to be either this weekend or early next week.

juroon’s picture

indytechcook, as I write this, the version for this thread is 6.x-1.0. I see that version 6.x-1.02 came out on Feb. 5, after your last message. Does that mean url aliases should now be working in 6.x-1.02? If so, exactly how should the path be configured both in the view page url and in taxonomy menu?

Thanks tons!

domineaux’s picture

I used this module in 5x and loved it. My gosh what a time saver when you have a site with a large taxonomy.

I ran this right after I got my pathauto working properly and never looked back. LOL

Several months ago I started another big site with thousands of taxonomy words (automobile site).

The cross-overs, connected words, tags, etc. make building a competent menu system a huge job.

Setting up the taxonomy has it's own problems. I use every drupal module I find that has taxonomy mentioned.

As I recall, I just let this module run and build the menu... then I took out what I didn't want. LOL

This is not the kind of module most people probably think about since they're building their nodes as they go kinda thing.

Not having it means that site devs like me have to find "other ways" and alot of time consuming work.

Thanks for this great contribution.

indytechcook’s picture

juroon, 6.x-1.02 contained bug fixes only (http://drupal.org/node/369639). 6.x-2 is currently being worked on and is a complete rewrite and will include path/pathauto functionality.

Thank you for your patience.

juroon’s picture

Thanks for the quick response, indytechcook. I'll be tickled to test whatever you come up with when it happens. I have a new site that's not live yet, all ready to go except for this. It has a view with the page url taxonomy/term/% which pulls up tagged imagefield nodes and displays them with views slideshow. It also has Pathauto url aliases with my taxonomy terms generated using [vocab-raw]/[catpath-raw] which pull up my view pages beautifully. Now I just need to get those term url aliases into the standard menu system so the menu items will grab my view pages instead of the default lists of tagged items. I didn't think this part would be so tricky, but I've tried everything else I could find to no avail.

I'll keep an eye out for the update, and stop banging my head against the wall in the mean while. You are my hero for working on it!

Edit: Didn't mean for that to sound so desperate. I am patient indeed, and quite happy just to know it's in the works.

indytechcook’s picture

Version: 6.x-1.0 » 6.x-2.x-dev
Category: support » feature
Status: Postponed » Active

A plugin is being written to work with the new version.

indytechcook’s picture

Assigned: indytechcook » Unassigned
Christolito’s picture

Subscribing

indytechcook’s picture

With the latest version (should be release within 12 hours), PathAuto is supported but you also must use views (or another page callback). Please see this post for more information and let me know what you think.

http://drupal.org/node/307117#comment-1273132

indytechcook’s picture

Status: Active » Fixed

Path Auto is now supported in latest DEV. Please see readme.txt on how to use it.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.