PHPJavascript

Web Development Guide – My Personal Library of Tutorials and Scripts

Drupal Views Taxonomy Parent Term and Child Term

August4

I wanted to display a block using views where the taxonomy parent and child needed to displayed in separate fields.

Eg Books Parent term: Adult and Child Term: Fiction

So block view should be such that

Book Title – Parent Term – Child Term ie Eclipse – Adult – Fiction

To achieve this Go to Views

  • Add “Relationships”
    • Select “Taxonomy: Parent Term” (use the default settings)
  • Add Fields
    • Select “Taxonomy: Term”
    • Relationship: Parent
  • Add Fields
    • Again Select “Taxonomy Terms”
    • Relationship: Do not use a relationship

Now we have reached our goal … simple but takes some digging …

posted under Drupal
12 Comments to

“Drupal Views Taxonomy Parent Term and Child Term”

  1. On August 20th, 2010 at 7:32 pm Petu Says:

    Thank you for simple article about relationship in views! Very clear and useful!

    Respect!

  2. On August 31st, 2010 at 10:53 am admin Says:

    Thanks … it means a lot!

  3. On March 2nd, 2011 at 7:39 pm manxon Says:

    Thank you I think this post should be at firt place in google

  4. On March 6th, 2011 at 7:08 am admin Says:

    The appreciation I receive from you all means more then that to me .. thanks!!

  5. On March 28th, 2011 at 10:18 am dhakshina moorthy Says:

    hai. it is not working. it is displaying the parent terms for two times

  6. On April 8th, 2011 at 4:03 pm Drupal – Create Views for Parent Terms or Children Terms Only | Eureka! Says:

    [...] Reference: Drupal Views Taxonomy Parent Term and Child Term [...]

  7. On April 18th, 2011 at 4:22 pm Daniel Arnolf Says:

    Sure, it seems so obvious, and yet, it took me forever to hit this page and really find out. On the way I learnt a lot of pre-processing and stuff, you know what I mean…
    Thank you so much.

  8. On April 21st, 2011 at 9:48 pm Weboldal Says:

    Just what I was looking for.
    Thanks!

  9. On April 22nd, 2011 at 4:29 pm Austin Says:

    I got this working with 3 layers. So the 3rd would be a child of a child. The only problem is that childs, which do not have sub-childs do not show up. I tried combining 2 arguments to allow either 2 layers of the 3 to be substituted into the url, but i could not figure it out. please help

  10. On August 16th, 2011 at 2:39 pm Michele Says:

    Wow. I’ve been doing views for years and never stumbled into the Relationships part of term views — thank you!

  11. On October 30th, 2011 at 1:56 am Daniel Says:

    What if you have to parent terms, such as country and state for a city?

  12. On November 28th, 2011 at 5:20 pm nasinandes Says:

    Great!!!

    Short but direct to heart!! :-)

    Thanks

Email will not be published

Website example

Your Comment:

 

12,958 spam comments
blocked by
Akismet