4

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

Laxman13
  • 5,226
  • 3
  • 23
  • 27
Evanss
  • 23,390
  • 94
  • 282
  • 505
  • This probably isnt the cleanest way but ive made a page-taxonomy.tpl.php and removed this: So far it seems this solution will work for my site, but id still like to know the proper way to do it. – Evanss Jun 28 '11 at 19:45

4 Answers4

7

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! :)

praimmugen
  • 228
  • 4
  • 5
6

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.

Sam
  • 358
  • 2
  • 11
  • 2
    You also need to clear `unset($variables['page']['content']['system_main']['no_content']);` **AND** `unset($variables['page']['content']['system_main']['pager']);` – Duncanmoo Nov 18 '13 at 13:51
  • http://drupal.org/project/disable_term_node_listings module does not work when taxonomy translation module is enabled – Goldengalaxy Aug 14 '17 at 14:35
  • `$variables['page']['content']['system_main']['#access'] = FALSE;` Would be cleaner and better practice. – Dane Rossenrode Mar 22 '18 at 20:40
1

This probably isn't the cleanest way but I've made a page-taxonomy.tpl.php and removed this:<?php print $content; ?> So far it seems this solution will work for my site, but I'd still like to know the proper way to do it.

Laxman13
  • 5,226
  • 3
  • 23
  • 27
Evanss
  • 23,390
  • 94
  • 282
  • 505
0

If all you want to do is override the taxonomy term pages with a View, but NOT use the default view, you could create a custom module implementing hook_menu() or you could also take a look at the Taxonomy Redirect module.

From the Taxonomy Redirect page:

This module allows the administrator to change the destination of Taxonomy Term links.

Laxman13
  • 5,226
  • 3
  • 23
  • 27