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.
By gargsuchi on
Is it possible to have the taxonomy term name instead of the taxonomy term ID in the URLs?
Basically what i am saying is that I have a term Delhi - with ID - 6.
Now the URL to this term is
http://www.myserver.com/taxonomy/term/6
can we do something to make it
http://www.myserver.com/taxonomy/term/Delhi
I need this to include RSS feeds from Drupal into other parts of my website - but naturally hte other parts of the site do not know the term ID - they know just the term.
TIA
Comments
You should enable (or
You should enable (or install if you don't already have it) the path module which allows you to rename (or alias) URL paths.
You might also want to have a look at the pathauto module for automation of this task.
Mike
That's a possible workaround
But filling up the aliases table (manually yet) seems to make a lot less sense than just
Indexing things by name.
Dries disagrees, but I think the pros outweigh the con.
It would have been trivial for taxonomy to parse_int(arg(1)) then taxonomy_get_term_by_name() if asked for a string.
I'll make one of them next time I'm playing with taxonomy.
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
Thanks
I am now using Path module - with pathauto to do this. but what dman suggested is certainly doable - and would be a good feature for taxonomy.