Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drupal - Disable listing of nodes on taxonomy term page?

Is it possible to disable the normal taxonomy listing of nodes on taxonomy term pages?

The reason I need this is I want to use a view's override of taxonomy pages BUT the default views override stops a breadcrumb module working properly. So, I want to make a term view but as a block and show it on certain pages with PHP.

Thanks

like image 323
Evanss Avatar asked Dec 09 '22 07:12

Evanss


2 Answers

Another way of doing this is using the Display Suite and Taxonomy Display module. Install them, then go to admin/structure/taxonomy/[mytaxonomy]/display.

Under "Use custom display settings for the following view modes" select "Taxonomy term page".

Then, in the "Taxonomy term page" view mode, under Term page display, select "Associated content display": HIDDEN.

Done! :)

like image 94
praimmugen Avatar answered Feb 01 '23 23:02

praimmugen


This module claims to do just what you are seeking, but it did not seem to work despite checking the correct taxonomy to disable:

http://drupal.org/project/disable_term_node_listings

But putting the following in your theme's template.php will suppress those node listings:

function MY_THEME_preprocess_page(&$variables) {
  if(arg(0) == "taxonomy" && arg(1) == "term") {
    $variables['page']['content']['system_main']['nodes'] = null;
  }
}

It's sort of a dirty way to do it, and you'll have to hide the pager using CSS, but it works.

like image 23
Sam Avatar answered Feb 02 '23 00:02

Sam