The problem I'm having is that I use aliases for my taxonomy terms, and I want to add more arguments to the taxonomy_term view. I don't know if it's by design, or if it can't be done, but it seems that if you're using an alias for the taxonomy term URL, you can't add an argument on to it or you'll get a page not found. For example, I'd like to filter my taxonomy term pages by content type, so I'd like to be able to make an argument for node type and use a URL like '(taxonomy term alias)/(content type)'.

I understand why this doesn't work, but I was hoping maybe this feature could be implemented in Views in the future. Or maybe there's a workaround to this issue?

Comments

merlinofchaos’s picture

Status: Active » Closed (works as designed)

This doesn't work at a level that Views cannot address.

Drupal's aliasing system doesn't handle arguments at all; this is why pathauto even exists. What happens is that an alias must be a complete URL for Drupal to translate it. If you have some alias in the system such as "alias/to/content", if you go to http://example.com/alias/to/content -- then yay, everything works and you end up at the 'real' destination, whatever that may have been. But if you go to http://example.com/alias/to/content/foo, the alias system goes "I don't see an alias by that name", and it tries to load that page. That page doesn't exist, and bam, 404.

There is absolutely nothing Views can do to address this. I wish there were.

harking’s picture

@merlinofchaos

I ran into this issue too due to the aliasing that pathauto is performing.

Would things work correctly if pathauto were patched to perform partial matches on URLs and then pass the remainder to the aliased URL?

I'll have to check the pathauto issue queue, this might be a feature request for D7 or future releases of pathauto.

EDIT: I mean the url_alias issue queue. Pathauto is just doing its job here :)

merlinofchaos’s picture

It's not possible for pathauto to be patched to do that, to my knowledge.

harking’s picture

I was thinking the path module but wrote pathauto.

merlinofchaos’s picture

Same difference, sadly. If you're interested, look in...I think it's bootstrap.inc (might be common.inc or path.inc as well, it's been a long time since I've looked at this) and search for 'url_alias' -- you'll see the code that does it. Doing a similarity test is somewhere between very difficult and expensive to not actually possible. And it's something Drupal cannot afford to have be expensive.

Now, if we can find a way to do a similarity test cheaply...that would be another story.

jshock’s picture

Has anyone come across a solution to this yet? This seems like a significant problem for Views. I want to use path-auto for obvious SEO reasons, however it seems I cannot use Views arguments in conjunction with url aliases. Is there an alternative solution to allow Views to find SEO friendly URLs?

There is a cryptic message in Views argument validation that says "if using term name, it is generally more efficient to convert it to a term ID and use Taxonomy: Term ID rather than Taxonomy: Term Name" as an argument." Unfortunately I can't find any explanation as to how to "convert it to a term ID". Also, compound terms ad hyphens & lowercase, so term names in arguments would be problematic anyway.

Any help or explanation would be greatly appreciated.

Using Drupal 6.22 and all modules current as of 8/1/11. -Thanks

jshock’s picture

It took me awhile, but I found out how to do this. It is really quite simple:

Select Arguments, use node id (Nid)'.
Then select "Provide default argument" and activate "Node ID from URL"'.