Sample:

fruits
- orange
- apple
salad
- apple

in my views:

- Taxonomy: Parent Term
- Taxonomy: Term ID (Argument: Term name/synonym converted to Term ID)

If I run this arguments salad/apple - I am getting a wrong term id for apple, instead its getting the apple term id from fruits parent term.

I tried also using the Relationship - Taxonomy: Parent Term - but still not getting the right child term id.

Comments

dman’s picture

Interesting.
I've never seen that tried before, although what you expect is clear, and makes sense.
I don't think that that argument handler is expecting to handle that - I've not sen that usage documented. Could be a unique feature request.
(I just tried that out to see. I get the first valid result - lowest tid, not by tree shape)

danieldd’s picture

I don't know if you are still trying to solve this but I have a similar vocabulary. However, in my case it seems to work with

(Parent) Taxonomy: Term
Taxonomy: Term

No doubt you've tried this, but just wanted to assure you it can work (using Views 6.x-2.8)

esmerel’s picture

Status: Active » Closed (fixed)

Solution suggested, no response.

balsama’s picture

Status: Closed (fixed) » Active

I'm seeing the same problem as nathanjo. But I don't think using "parent term" will work in my case as my vocab hierarchy is more than one level deep. For example:

-Breakfast -01
--Dessert -02
---Fruit -03
--Pancakes -04
-Dessert -05
--Fruit -06
--Candy -07

The argument Breakfast -> Fruit is returning values for 01->06 instead of 01->03. Similarly, the argument 01->02 is returning as 01->05.

Any ideas on how I can get this to work?

danieldd’s picture

Are you using Argument: Term name/synonym converted to Term ID?

If I remember correctly I think that setting can resolve to incorrect TIDs in these circumstances. I was using the Taxonomy: Term setting which worked with a 2 level heirarchy.

However I have not tried configuring arguments to a deeper heirarchy with multiple duplicated term names. That sounds quite complex. If you are trying to do this, I would also be aware that there can be performance issues trying to use complex taxonomy queries with Views, particularly if you have a large number of nodes.

balsama’s picture

Yes, I am using "Term name/synonym converted to Term ID". I didn't do a very good job of explaining it completely.

If you have two terms with the same name, it returns the term with the lowest TID regardless of where it lives in the hierarchy.

I think I'll end up creating separate views for each of the top-level terms and restrict second and third level terms to unique names within a parent.

It would be nice if views was able to filter/use arguments from the top-level down. (e.g. example.com/parent-term/child-term/child-term)

danieldd’s picture

Yes, using "term: name" instead of "Term name/synonym converted to Term ID" may resolve part of the issue.

How many nodes are you categorising? In my experience if you are using complex taxonomy arguments on a large dataset performance can be an issue.

balsama’s picture

Thanks. You're right. Term: name did the trick. I guess that's because it's returning all values tagged with "foo". Ones that are outside the branch I'm targeting are omitted via a filter, and terms are not repeated within a branch.

We're categorizing about 3,500 nodes. But we can cache the view and the site runs on a CDN.

esmerel’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.