How do I show the number of nodes using a taxonomy term? Somebody asked Views and node count for taxonomy terms. I am trying to do the same, but with Drupal 8.

I follow the steps reported in that question, and I get a count of the taxonomy term (say "fruit"), but when I click on it there is a page that lists "fruit" multiple times, instead of listing the pages themselves.

If I do not do a count. then when I click on the taxonomy term I get the correct listing page (e.g. apple, orange, pear).

Can anyone help me with this?
The following worked for me in Drupal-8.0.6.

Note that for some reason 'Content NID' is not offered as a field for the 'Content with term' relationship, so I used UUID instead and it worked.


Create a Taxonomy Term view (with a field Taxonomy term: name, usually linked to the term page)
Relationship > Taxonomy term: Content with term (will be called node).
Advanced: Use aggregation: Yes
Add Field > Content: UUID with relationship node
Aggregation type for UUID = Count


You may have to play with COUNT vs COUNT distinct

If you want tbe count to appear in brackets like this:

linked_term (count)


On UUID field use Rewrite results:

({{ uuid }})


Note that it is using the new Twig template language notation.