hi notice site map doesn't seem to use aliases for the urls it creates, is there anyway to make it do this?

I saw there was another request for this that was listed as a duplicate but for the life of me i can't find where the answer was in bugs, readme or cvs message browsing.

thanks for this great module

Comments

frjo’s picture

Status: Active » Fixed

Sitemap already use path alias, just like the rest of Drupal does. All links is built with the standard l function, http://api.drupal.org/api/function/l/5.

kalin9’s picture

Okay,

I took a closer look it looks like it's most often caused by site map making urls like

/taxonomy/term/44/all

instead of

/taxonomy/term/44

So pathauto (what i assume most of us are using not just url alias) might have already made an alias for the latter, but not the former.

I was able to change this so that it use the latter term, and find the alias by hacking

//$output .= l($term->name, "taxonomy/term/$term->tid/$cat_depth", array('title' => $term->description));
$output .= l($term->name, "taxonomy/term/$term->tid", array('title' => $term->description));

i don't claim to have looked at it enough to know if it will cause other issues.

so for me the only ones it now doesn't show the alias for is my forums, and that looks to be same thing. it finds the taxonomy url but that isn't the more commonly already aliased url. I'm looking to see if I can hack a fix for that.

Anyway personally i'd suggest this as an option/tweak or patch, if you had the time and were inclined. I think most of us are going to want it to try to use aliases and will have urls as aliased by path auto. thanks

frjo’s picture

There is already a setting for this:

Categories depth:
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.
niklp’s picture

Title: Anyway to make site map use aliases? » Site map causes duplicate content via URL mismatch
Priority: Normal » Critical

This is NOT fixed in 1.1. The option to put -1 in that box doesn't exist in that version.

There are a couple of other issues on this "all" front, and I notice they are not getting attention.

Further to the above problem, which could be addressed by upping the dev -> 1.2, a similar problem also exists with RSS. (FYI I am using the default View, taxonomy/term, here).

If I have no pathauto installed, I would normally get urls (per term/feed pair) of:

/taxonomy/term/1 and taxonomy/term/1/feed

If I have pathauto installed, this changes. If I set categories depth to -1, and RSS feed depth of 0, I get:

/blog/tags/whatever and /blog/tags/whatever/feed - this won't work with Views - the latter url maps to the same content as the first url. This is duplicate content, and is a serious issue. This simply will not work with Views.

If I set RSS feed depth to "all" now, instead, the latter url is still not effective: /taxonomy/term/10/all/feed

This is still not going to work with Views, and again is duplicate content.

Also, under both the last situations, feeds simply don't work, because Views cannot handle the arguments that site_map passes.

If site_map used /taxonomy/term/x/feed - this works fine. I think the issue is caused by Views, but this view is used a LOT so this should be checked for.

niklp’s picture

Status: Fixed » Active

Forgot to change status, bah.

niklp’s picture

Spoke to greggles and a couple other people (regarding new feed aliases in pathauto 2.1) and can confirm that this is a site_map.module problem, caused by views overriding the taxonomy/term output.

frjo’s picture

Status: Active » Closed (won't fix)
niklp’s picture

Can you give at least a reason why it's "won't fix" please? :)

frjo’s picture

Priority: Critical » Normal

Because the problem comes from using a example taxonomy view.

If someone contribute a good patch that checks for this I will commit it.