Taxonomy child terms list and product list view


A relatively easy way to do this, would be using Views. You would need two of them:

A) First you will need to have a view display products. This view has a contextual filter (taxonomy term) that filters based on the "Products Categories" field set on the products.
B) Secondly you would set up a view that displays taxonomy terms. You need a contextual filter (taxonomy parent term). This means that you expect a term as an argument to your view, and your view will display all children of the argument.
C) You need to configure View A to display View B when there are no results. That means that if View A does not deliver any products for a given taxonomy term, View B should display all children of the given term.

I tried this locally and it works as you described in the OP.

Hope this helps

Here's my tutorial video (I've published this step by step in many places):


  1. Create a Taxonomy Vocabulary here: admin/structure/taxonomy (And create a few terms)

  2. Create a Taxonomy View here: admin/structure/views/add

You want to make sure that you choose "taxonomy" entities.

  1. Add a contextual filter for "Taxonomy term: Parent term"

Make sure to select "Default Filter" and choose "Taxonomy term from url." Also, specify a "Default validation criteria" for "Taxonomy term" and choose "Convert taxonomy name to ID" and select "Transform dashes in url..."

  1. Add a new page to this view, remove the contextual filter from this view and add a filter for "Taxonomy term: Parent term" and set it to "equal to" and leave the field there blank.

  2. Save that view and create a new view here: admin/structure/views/add

Make sure this view is a for "Content" of type "Product Display" (or whatever entity bundle has the field for your taxonomy terms).

  1. Add a contextual filter for your taxonomy term, mine was called "Product Categories"

Make sure this contextual filter displays "Contents of No Results." Also, specify a "Default validation criteria" for "Taxonomy term" and choose "Convert taxonomy name to ID" and select "Transform dashes in url..."

  1. Add a "No results" item called a "View Area" and select "Page_1" from your first view (this is the second page we created)

  2. Save this view and go back to the first view.

  3. Add a "No results" item called a "View Area" and select the second view that we just made.

  4. Make sure your title field in the Taxonomy View doesn't link to the taxonomy term, but it outputs the field as a link to "catalog/[name]" that way your catalog names are clickable :)

  5. Profit!

Similar questions

Creating a list of child taxonomy terms with Views
I have a a taxonomy with 2 levels: When I am on /taxonomy/term/parent1 I want to display a view of a list of child terms in a block: Child 1 Child 2 Child 3 I have been through similar questions on this site, some with accepted answers, but it did not help me. Here is my Views settings. For now, it displays the term name for each node containing th...
Using views, how to render a block of father terms with a brief shortlist of child terms?
I've a list of taxonomy terms with related subs as follows: Father 1 Father 2 Father 3 and so on. I need to put a list of the father followed by the first 5 child elements in a block and put it into homepage. Now the point is, that after lots of trying, I didn't find a solution about how I can do this. The only thing that I managed was the selectiv...
How to get child terms based on parent terms between two different taxonomies
I have created two vocabulary I want to load the topics based on the program selection. It looks like category and subcategory. I created some program like java, .net, PHP and I created some topics like session (php), inheritance(java), cookie(php). So now I want to list all the topics which are coming under a particular program. Can you tell me wh...
Generate a view with parent - child taxonomy terms
Is there any way that I can create a view of parent-child taxonomy terms that would look alot like this? I was thinking I could use the parent relationship and then group terms and print in a grid but there is no options for parents to be a group field.
View to display all child taxonomy terms
I have a content type called "Unit Staff" with a term reference field called "Department". I also have a vocabulary called "Person" which is using a paragraph field consisting of a date field and the same "Department" vocabulary as a term reference. Every department has several child terms. I want to create &...
How can I show parent and child terms in facet search filter block for a taxonomy field having simple hierarchial select as widget type
I am using facet filter to filter views values . I have a taxonomy term using widget type [Simple Hierarchial Select][1] . I want to be able to filter parent and child terms both in facet filter block Tax A -- Tax A child ---- Tax A child of child I want to use each one of the above as a filter in the facet filter block How Can I achieve it? I have...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.