I thought this would be pretty simple to set up, but being a newbie, I'm having a lot of difficulty with using the Custom Path feature with sub-terms.
What I need: http://www.mysite.com/departments/human-resources
What I'm getting: http://www.mysite.com/departments/321
After reading the README.TXT, the Taxonomy Menu documentation, and other similar issues, these are the steps that I took:
- Created a new content type titled "Departments".
- Created a new URL alias (pathauto) "departments/[node:title]" and taxonomy term path "[term:vocabulary]/[term:name]".
- Added a new department view titled "Human Resources".
- Created "Departments" view with departments/% as it's path, and a Term ID and Term (with depth) and Term ID depth modifier.
- Created a "Departments" taxonomy vocabulary with the following settings:
- Menu location: Departments
- Menu path type: Custom (/%)
- Custom Path Options > Base Path: departments
- Added "Human Resources" term under "Departments" vocabulary with "departments/human-resources" as the path.
- Re-ran the menu creation job under Taxonomy > Departments (Rebuild the menu on submit) with the new menu item and settings from #5.
Result:
I'm not sure how to proceed at this point. If anyone could help with an answer or some ideas, it would be much appreciated. I've attached 4 screenshots of my settings; hopefully they help. I'd really like to use this module, but this issue has to be resolved for me to do so.
Comments
Comment #1
hles commentedA few things to consider:
- Depth modifier in the vocabulary interface should be a number
- Path of your view should be depatments/%/% (if you use the depth modifier, else departments/% only)
- The path is generated correctly, maybe you can tell us what alias you defined in pathauto interface for this vocabulary.
Comment #2
katannshaw commented@hles: Thanks for the quick reply.
Ok, that's good to now. I don't want to use #'s in that place, as I was wanting to use a full path that's set in the taxonomy itself. So I'll remove the depth modifier.
For the Human Resources term within the Departments vocabulary, the URL alias/pathauto is set as: "departments/human-resources". But when I hover over or click on that button, it's path is set as "departments/321" instead. This seems to only happen for me with Views.
Thanks again. I hope to hear from you soon.
Comment #3
hles commentedWell, this is not possible at the moment, although this could probably be done. Changing title and category.
Comment #4
katannshaw commentedThat would be great! I'll keep an eye on this feature request's status, and I'll use the standard menu setup for the main menu until this feature is added. Thanks for your assistance hles.
Comment #5
johnvMarked #851630: 'Custom menu path' doesn't add more than one level in menu as a duplicate.
Comment #6
digitalfrontiersmediaI had a similar problem and needed to use the term name instead of the term id, which is often preferable when possible for SEO purposes where bulk aliasing these paths might be a pain. So I created the attached patch which seemed to work well.
Caveat #1: while taxonomy will support a child term with an identical term name as its parent, if you are using tm_custom_paths to generate a menu leading terms to a view other than taxonomy/term/% and you are using a contextual filter to convert term names as term ids, this would obviously fail since it wouldn't be able to tell which term id it was supposed to resolve to. It's possible you could re-alias a specific term to a derivative alias like [term_name] v. [term_name]-1, though, and I have some code in the patch which would support that as an option. However, that code is commented out since I didn't really explore which order it would create the derivative menu items in.
Caveat #2: to keep from re-inventing the wheel and to try to match already established aliasing patterns, I use a few function calls from pathauto and token modules. Thus, this patch now adds those as dependencies.
To use, simply select the new "Generate menu links using term names instead of Term IDs (tids)" checkbox under "Custom Path Options".
Give it a go if you like.
Comment #7
digitalfrontiersmediaAssigning to self and re-submitting patch for automatic testing...
Comment #9
digitalfrontiersmediaI think the automated tests are somehow broken for 7.x-2.x? The details on the above automated test specifies the following fatal error:
How is _taxonomy_menu_get_mlid() undefined? It appears in 7.x-2.x taxonomy_menu.database.inc and nothing in tm_custom_paths.module seems to even call it (directly in any case).
Comment #10
chunty commentedHas this been applied to the dev version and how does one access the dev version. I found it wouldn't full apply to the alpha2 version because there are difference in the lines on the tm_custom_paths.module file
And because taxonomy_menu_path_custom takes 2 parameters taxonomy_menu_path_custom($vid, $tid) but in this patch file it seems you are now just using $term;
Ta
Chris
Comment #11
vladimirausThank you for your contributions.
Drupal 7 is no longer supported.
Closing this issue as outdated.