[drupal-devel] taxonomy nice URLs

Moshe Weitzman weitzman at tejasa.com
Wed Mar 23 15:12:45 UTC 2005

can we not keep on supporting the existing, non ambigous urls. these 
urls are great, but not appropriate for certain links. also, some people 
insist on localizing their links which is insanity but there you go ...


> I did some work last night on tying to implement text URLs instead of 
> the current numeric ones for taxonomy pages. So
> /taxonomy/vterm/Tags/horse+riding
> instead of
> /taxonomy/term/23
> What I've been trying is /taxonomy/vterm/vocab_name/term_name
> all nodes for term term_name in vocabulary vocab_name using vterm means 
> that the old /term/ still works.
> I think /taxonomy/tterm/term_name is a mistake because nodes in Forum:UK 
> (say) are not necessarily grouped or similar to nodes tagged with 
> Location:UK. But maybe there is a good reason to group all nodes with 
> the same spelt tag even if the tags are from different vocabs.
> To achieve this I needed two helper functions
> taxonomy_get_vocabulary_by_name($name)
> taxonomy_get_term_by_name_and_vid($name, $vid)
> It's then pretty easy to take
> /taxonomy/vterm/Tags/horse+riding
> and turn it into a comma delimited set of tids (probably just one)
> and pass it to taxonomy_term_page();
> In taxonomy_get_term($tid), a join to {vocabulary} to get the 
> vocabulary.name field makes modifying taxonomy_link to generate these 
> urls easy.
> Thoughts?

More information about the drupal-devel mailing list