I have multiple Content Taxonomy fields pointing to a single vocabulary. On the theme level, how do I link a Content Taxonomy created term/string to its respective vocabulary term?

So far I've been using a snippet of code stored in my template.php to link up a vocabulary:

function phptemplate_taxonomy_links($node, $vid) {
  if (count($node->taxonomy)){
    $tags = array();
    foreach ($node->taxonomy as $term) {
       if ($term->tid == $vid){
          $tags[] = array('title' => $term->name, 'href' => taxonomy_term_path($term), 'attributes' => array('rel' => 'tag'));
       }
	}	
    if ($tags){
      return theme_links($tags, array('class'=>'links inline'));
    }
  }
}

All I have to do is enter the $vid and it will list and link every term in a vocabulary. But in my case I don't want to list every term, I only want to list terms created by a specific CT field.

I'm finding the real road block is figuring out how to match a CT created field:
$node->field_fieldname[0]['view']
With it's Taxonomy partner:
$node->taxonomy[591]->tid

Any thoughts?

Comments

Junro’s picture

Hi, I'm looking for it too.

Content taxonomy terms are not display with their link.

Have you find a solution?

Junro’s picture

Status: Active » Fixed

HUm, it's very simple, juste set "display text as link" in display fields of your content type setting.

maedi’s picture

Junro, you're a star, so easy!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

AntiNSA’s picture

Priority: Normal » Critical
Status: Closed (fixed) » Active

I have selected link to taxonomy and I still cant see the link.

Junro’s picture

Strange...

AntiNSA’s picture

In views I am using it with views group by and when I select "Link this field to its taxonomy term page" I get no link.

Junro’s picture

Just set "display text as link" in display fields of your content type settings.

AntiNSA’s picture

Status: Active » Closed (fixed)

I am sorry , I was making a mistake. I was using the group by function of views, which is a module that allows you to group term with node id and then counts... the problem is with that module I guess. I have found a solution to use the nodecount instead.... thanks