1
votes

How can I hide node content from the taxonomy term page. That was the related content (Term reference node) of that particular taxonomy term.

I am trying to hide it using hook_preprocess_taxonomy_term(&$variables), but I'm unable to resolve the issue. Please suggest the best solution for that.

2

2 Answers

1
votes

There's a Drupal 7 module that does this: Disable Term Node Listings

Having looked at it's code, not sure it's possible to translate it to D8.

There's a more active question here - one of the answers suggests using MY_THEME_preprocess_page:

Drupal - Disable listing of nodes on taxonomy term page?

0
votes

I tried this on drupal 9 today there is a default view called Taxonomy term(taxonomy_term) for displaying content related to taxonomy term on /taxonomy/term/% if you want to override display of all the vocabularies you can simply go to views (/admin/structure/views/) and disable the Taxonomy term view and then you can change the display settings of a vocabulary in the Manage Display section. It is not completely though.