Linking a Content Taxonomy field with its respective Vocabulary Term

Maedi - April 28, 2009 - 08:07
Project:Content Taxonomy
Version:6.x-1.0-beta6
Component:Code
Category:support request
Priority:critical
Assigned:Unassigned
Status:closed
Description

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?

#1

Junro - August 27, 2009 - 11:32

Hi, I'm looking for it too.

Content taxonomy terms are not display with their link.

Have you find a solution?

#2

Junro - August 27, 2009 - 11:46
Status:active» fixed

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

#3

Maedi - August 29, 2009 - 08:03

Junro, you're a star, so easy!

#4

System Message - September 12, 2009 - 08:10
Status:fixed» closed

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

#5

AntiNSA - October 1, 2009 - 17:03
Priority:normal» critical
Status:closed» active

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

#6

Junro - October 1, 2009 - 17:15

Strange...

#7

AntiNSA - October 1, 2009 - 17:20

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.

#8

Junro - October 1, 2009 - 18:33

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

#9

AntiNSA - October 2, 2009 - 03:42
Status:active» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.