Simple patch to save the full taxonomy in the node object. This allows a custom template to access the taxonomy, even though it does not show up as links like it normally would.
The trimmed taxonomy is still $node->taxonomy, and the full taxonomy is saved in $node->taxonomy_full.
--- taxonomy_hide.module.orig 2007-10-24 09:46:45.000000000 -0400
+++ taxonomy_hide.module 2007-10-24 08:43:40.000000000 -0400
@@ -95,6 +95,8 @@
function taxonomy_hide_nodeapi(&$node, $op, $arg = 0, $arg2 = 0) {
switch ($op) {
case 'view':
+ // copy the taxonomy so it is still accessible
+ $node->taxonomy_full = $node->taxonomy;
// Get all hidden vocabularies; keys of $hidden are the vocabulary ids.
$hidden = array_filter(variable_get('taxonomy_hide_vocabularies', array()));
if (count($hidden) && !empty($node->taxonomy)) {
Comments
Comment #1
jredding commentedI'm don't agree that this patch is desirable as it duplicates data in the node, thus bloating it. If a theme or another module wants specific taxonomy data they can always get it with
taxonomy_node_get_terms_by_vocabulary()
Which is actually better because they can pull just specific taxonomy data versus the entire tree.
Just my two cents though.
Comment #2
David Lesieur commentedI agree with jredding. I might add that a module or theme would end up relying on taxonomy_hide to use the new data proposed by this patch, which seems quite unnatural.
Comment #3
brmassa commentedGreg,
Jacob and David are right. It will duplicate the data and the same result can be achieved thru other means.
regards,
massa
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.