4

I've managed to got my view working but my worry is that this method is not dynamic.

What I want to achieve? To have a list of articles tagged with terms that are one level deep (children) but not their parent terms.

E.g.: assuming a taxonomy looks like this:

A 
  A1
  A2
B
  B1
  B2

I want to be able to go to the URL mysite.com/A/A1 or mysite.com/B/B2 and retrieve a list of articles with ONLY content tagged with A1 or B2 (in this example)

For that I added a filter and manually selected the parent terms I don't want to list:

enter image description here

Is there a better solution to achieve this?

Thanks!

  • try taxonomy term with depth – Bala Dec 5 '13 at 10:26
3

Super simple but impossible to guess solution :

With a normal filter set the "Parent term" filter not equal to "0".

This will filter parents

1

In your view:

Contextual filters

Content: Has taxonomy term ID (with depth)

 Depth: 1
 When the filter value is NOT available :
   Type : Taxonomy Term Id from url
   & Select Load default filter from term page      

Content: Has taxonomy term ID depth modifier

Hope this will help you to get the result.

0

From Contextual filters select:

Content: Has taxonomy term ID and select checkbox Provide default value "taxonomy term id from url" and select checkbox " Load default filter from term page"

and In Relationship:

Relationships Content: Taxonomy terms on node and select checkbox REquire this relationship.

I hope this will work you.

  • Haven't tried this solution. The one above did the job. Thanks! – Teknotica Dec 7 '13 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.