0

I'm looking for a dummy's guide on how to configure the default taxonomy term views so that I can display an exposed filter of child terms on the parent page.

Assuming I have the taxonomy structure below.

  1. Sports
    • Football
    • Basketball
    • Boxing
  2. Entertainment
  3. Politics

I want when I'm on Sports page, there is an exposed filter where I can select either of football, basketball or boxing.

I have followed all tips I could find online but the option to add contextual filter of "Taxonomy Term: Parent term" was not available.

2
  • What do you mean "Sports page"? How many pages have you got? Isn't this just one Views? Is this about the default "Taxonomy term" Views or a custom views of your own? Does it have to be exposed filter or can it be a list of links to the sub-categories (don't assume technological details, simply state your feature description)?
    – prkos
    Feb 22, 2019 at 0:22
  • It's the default "Taxonomy term" view and I meant the page display of this default view. It doesn't have to be an exposed filter, a list would do but I don't want a vertical list, an inline list of child terms would suffice. Feb 22, 2019 at 9:06

1 Answer 1

1

You can create a separate Views of type Taxonomy term (not content!) display Block that is showing taxonomy term names, add the Relationship to the parent term and require it, and a Contextual filter to taxonomy term ID using that relationship.

Test it by entering parent term ID into Preview, you should see the parent's children.

Edit the Format to set the fields to display inline, or use CSS (later) to make them appear horizontally.

Then in your Content (original) Taxonomy Term views add View area into Header and choose the above Block with Inherit contextual filters option ticked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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