Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
On _site_map_taxonomy_tree, "/all" suffix on categories forbids URL alias rendering. This results in asymmetry between aliased categories path (on nodes) and category path generated by sitemap.
Here's a patch (on 5.x-1.2 version) to solve this issue. If "all" suffix is detected, taxonomy_term_path($term) is returned instead "/all" suffixed version.
Comment | File | Size | Author |
---|---|---|---|
catalias.patch | 605 bytes | chirale | |
Comments
Comment #1
chirale CreditAttribution: chirale commentedComment #2
frjo CreditAttribution: frjo commentedI guess that you like everyone else that has this problem is using pathauto module and it happens to autogenerate path aliases for taxonomy/term/[id] with out any "/all" or "/0" etc. on the end.
I believe your problem will be solved with entering "-1" for "Categories depth" in the site map settings.
The description for that settings state "Specify how many subcategories should be included on the categorie page. Enter "all" to include all subcategories,"0" to include no subcategories, or "-1" not to append the depth at all."
Comment #3
frjo CreditAttribution: frjo commentedComment #4
chirale CreditAttribution: chirale commentedWell, I used a block with this PHP code to return a "flat" category tree with no subcategories.
Result (demographic)
Then, I leave the separated sitemap page as is. Result
I want Sitemap page show the entire tree, but when a single category has no subcategories now I have to set that flag to -1 globally? Thanks.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #6
-Mania- CreditAttribution: -Mania- commentedThanks, setting the "Categories depth" to -1 worked for me. However the RSS icons were still linking to system paths. I set the "RSS feed depth" to 0 to fix that.
Comment #7
nickonom CreditAttribution: nickonom commentedSetting "RSS feed depth" to 0 as suggested in #6 didn't help, so I had to use https://www.drupal.org/project/path_alias_xt. I wonder was this changed since -Mania- succeeded to get it right 6 years ago?
Comment #8
thallesThanks @all!
issue fixed for no activity.
Comment #9
thalles