it would be funky to hide dependent on teaser / full view.

Comments

doublejosh’s picture

+1

doublejosh’s picture

I did this in a custom module like this (meaning unfortunately content types are hard coded)...

function MYMODULE_link_alter(&$links, $node) {
  // get rid of taxonomy term links
  if($node):
    switch($node->type) {
      case 'NODETYPE' :
	if($node->teaser):
	    foreach($links as $k => $l){
		if(substr($k,0,14)=='taxonomy_term_') unset($links[$k]);
	    }
	endif;
      break;
    }
  endif;
}
doublejosh’s picture

There is also a template level way like this...

function MYTHEME_preprocess_node(&$vars, $hook) {
  switch($vars['node']->type) {
    case 'mynode_type' :
    case 'another_nodetye' :
      // Dispatch with vocabs if in teaser.
      if(!$vars['page']) unset($vars['terms']);
    break;
  }
}
gmaximus’s picture

I just tried using the method explain in #2 but it broke the site... Any ideas?

I can't do it at the theme layer because the teaser is being used to generate a email...

Thanks...

gmaximus’s picture

I got it working with this:

<?php

/**
 * This function will remove taxonomy terms from the content type "Act" when viewed in teaser mode.
 */

function MYMODULE_link_alter(&$links, $node, $comment = NULL) {
  // If content type is act
  if($node):
    switch($node->type) {
      case 'act' :
      // If Teaser
    if($node->teaser):
    // Remove links
        foreach($links as $k => $l){
        unset($links[$k]);
        }
    endif;
      break;
    }
  endif;
}