Score:0

How can I show child categories in the parent category page?

ch flag

I have created a new vocabulary with some extra fields and these taxonomy terms.

  • Parent 1

    • Child 1.1
    • Child 1.2
    • Child 1.3
  • Parent 2

    • Child 2.1
    • Child 2.2
    • Child 2.3
  • Parent 3

  • Parent 4

  • Parent 5

In the parent category page, how can I show child categories with images or other custom fields?

Score:0
mx flag

The way terms are related is from child towards parent, not parent towards child.

So you need to start with taxonomy term views (Block Views Display) showing all the terms, filter them according to Parent term to only show children terms, this will show all of them, no matter what parent, but will not show parents (because they don't have parents of their own).

You can directly add any custom fields you have on the terms because this is a term type Views.

Then add a contextual filter for the Parent term, (Provide Default Value, from URL context).

When you place the Block on the page of the Parent term (don't forget to set the Block filter option) it will automatically filter it to show only the children terms of that parent.

This may need a bit different solution if Block is to be placed on a node Views type. Node type will already have a contextual filter for terms and the additional contextual filter for child terms will have to work together with it.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.