2

'State' is the vocabulary of my taxonomy where North, South, East & West are parent terms with child terms like Montana, Texas, New York, Washington respectively which are states of USA.

I've created some dummy nodes on based of the child terms from taxonomy, is there any way to display the count of nodes from the parent terms of that taxonomy, so that the result would be something like North 10, South 5 and so on

2 Answers 2

0

Although this is an old question, I just had to do something similar and decided to share the steps (I'm using views 3):

  1. Create a content view listing your nodes.
  2. Add a relationship "Content: Taxonomy terms on node", limit this to the "States" vocabulary and give it an Identifier like "term_on_node".
  3. Now add another relationship "Taxonomy term: Parent term" using the "term_on_node" relationship defined in the previous step. Name this one "parent_term".
  4. Enable "Use aggregation".
  5. In "Format" select to show fields.
  6. Add the following fields:
    • "Taxonomy term: Name" using "parent_term" relationship
    • "Content: Nid"
  7. For "Content: Nid" click "Aggregation settings" and select "Count DISTINCT"

Now this view should display your parent terms with the number of nodes assigned to each parent's children.

0

Try creating a Taxonomy View with the following settings.

  • field: taxonomy term/id
  • filter: taxonomy vocabulary; states vocabulary
  • contextual filter: taxonomy term parent; display summary, show link w/ count, set a base url for link

I have done something similar with a contextual filter of Taxonomy Term/ID and it works fine. Should work with Term Parent. you might have to add a relationship to content as well, not too sure but that should get you started. Good luck!

1

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.