I need to implement a way to show only the taxonomy that is controlling access to a node in the 'links' area of the node. Currently I can show all associated terms, but that is too much and too confusing, not being specific to access control. I'm going to be looking into it more, but any help in letting me know how to list the taxonomy that tac_lite it using would be appreciated!
This is what I know so far, this code below from theme.inc will pull all associated taxonomy terms for the node and theme it. Beautiful - we should do this from tac_lite. But we'll need a taxonomy_link function specifically for tac_lite.
if (module_exist('taxonomy')) {
$terms = taxonomy_link('taxonomy terms', $node);
}
if (count($terms)) {
$output .= ' <small>('. theme('links', $terms) .')</small><br />';
}
Here is the current taxomomy_link function, taken from http://api.drupal.org/api/4.7/function/taxonomy_link
function taxonomy_link($type, $node = NULL) {
if ($type == 'taxonomy terms' && $node != NULL) {
$links = array();
if (array_key_exists('taxonomy', $node)) {
foreach ($node->taxonomy as $term) {
$links[] = l($term->name, taxonomy_term_path($term), array('rel' => 'tag', 'title' => strip_tags($term->description)));
}
}
return $links;
}
}
So, anyone know how to revise that function to spit out only terms used for tac_lite? yogadex? :)
Thank you!!!!
Jamie.
Comments
Comment #1
JamieR commentedIs this where we get the taxonomy terms controlling access to the node?
Perhaps I'm getting closer...
Comment #2
Dave Cohen commentedHere's a snippet from the latest tac_lite that may fit your needs. You're going to have to experiment...
And BTW, this is not really relevant to tac_lite, as it has nothing to do with the links shown with each node. You're probably going to have to modify your theme to do what you want.