1

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.

MilanG
  • 6,994
  • 2
  • 35
  • 64
harish patel
  • 136
  • 11

2 Answers2

2

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.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Shriaas
  • 21
  • 3
1

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?

William Turrell
  • 3,227
  • 7
  • 39
  • 57