Hello,
i want to handle my taxonomy term pages with Views, but i need to find a workaround to let Views override taxonomy's aliases.
So, let's say that the good alias is "colors/blue", i assigned to the 'color' term a different alias, like "colors-tax/blue", while the view is correctly showed on "/colors/blue".
The problem is, that the tags on the node page are linked to the wrong page, ie. colors-tax/blue, so i need to find a way to tell Drupal to change all the links with the "-tax" suffix to the correct links.
I tried adding this code to the hook_url_inbound_alter() function in system.module, without success.
if($path=='colors-tax/blue') {
$path = 'colors/blue';
}
Is what i want to do possible? How?
Thanks!
Comments
I solved by altering the
I solved by altering the drupal_get_path_alias() function, even if this solution looks a bit awful to me.
Anyway, can i override this function, so that i don't have to re-apply the changes everytime i update drupal core?
If you use the taxonomy view
If you use the taxonomy view that comes with views (it over rides the default taxonomy/term/{tid} path) and use pathauto to create your path alias things should work without any need to override paths.
great tip
Thank you Nevets. This is a great tip. It makes overriding your taxonomy display super-easy.
A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com