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 |
Jump to:
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
Hi, I'm looking for it too.
Content taxonomy terms are not display with their link.
Have you find a solution?
#2
HUm, it's very simple, juste set "display text as link" in display fields of your content type setting.
#3
Junro, you're a star, so easy!
#4
Automatically closed -- issue fixed for 2 weeks with no activity.
#5
I have selected link to taxonomy and I still cant see the link.
#6
Strange...
#7
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
Just set "display text as link" in display fields of your content type settings.
#9
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