Indra
Indra

Reputation: 1

How to retrieve taxonomy term name in url instead of id in a drupal view?

I'm currently working on Drupal 10 and utilizing Views with filter criteria. However, when I apply filters to my view, it shows the ID of the taxonomy term instead of its name. How can I ensure that it displays the name of the term instead of the ID? Essentially, I want it to show something like 'keys=&theme=operateur' instead of 'keys=&theme=2'.

I tried configuring contextual filters, but nothing seems to work.

Upvotes: 0

Views: 361

Answers (1)

2pha
2pha

Reputation: 10155

Check this answer on the drupal specific stack site.

Basically, you'll have to add a taxonomy term relationship to the view.
Then the taxonomy term name should be available to be added as a filter.

I think (but not 100% sure) the taxonomy term name exposed filter will be a textfield at this stage, but you could then use a form alter to change it to a select list and populate it with the relevant term name values as options.

Upvotes: 0

Related Questions