I am using Ubercart and want to display products by term from a vocabulary called 'catalog'. The catalog vocab has a two-level hierarchy to group similar terms together, eg:

  • badges
    • special badges
    • discontinued badges 

The View needs to take the term from the path and I can do this using a contextual filter 'Content: Has taxonomy term ID (with depth)'. I have a View and this works fine using term id but I'd like it to use the term name instead.

That is, this works correctly (where badges: tid=4, special badges: tid=8):

  • shop/4
  • shop/8

but what I really want is:

  • shop/badges
  • shop/special-badges

How can I do this?

My current View is displayed below.

Comments

Olafski's picture

I don't know the details off hand, but I guess you can use terms instead of IDs after adding a  "Taxonomy terms on node" relation to the view.

Thanks for commeinting, @Olafski - in fact it turned out to be simpler than I thought and I now have a solution.

Having selected contextual filter 'Content: Has taxonomy term ID (with depth)', I then noticed the Filter value type 'Term name converted to Term ID'. I selected this and now it works as I wanted.

I'll add screen shots of the relevant config for my own benefit but also in case anyone else has this problem.