Closed (fixed)
Project:
Content Taxonomy
Version:
6.x-1.0-beta6
Component:
Code
Priority:
Critical
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 Apr 2009 at 08:07 UTC
Updated:
2 Oct 2009 at 03:42 UTC
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
Comment #1
Junro commentedHi, I'm looking for it too.
Content taxonomy terms are not display with their link.
Have you find a solution?
Comment #2
Junro commentedHUm, it's very simple, juste set "display text as link" in display fields of your content type setting.
Comment #3
maedi commentedJunro, you're a star, so easy!
Comment #5
AntiNSA commentedI have selected link to taxonomy and I still cant see the link.
Comment #6
Junro commentedStrange...
Comment #7
AntiNSA commentedIn 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.
Comment #8
Junro commentedJust set "display text as link" in display fields of your content type settings.
Comment #9
AntiNSA commentedI 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