I am trying to print out the values within a hierarchical select'ed taxonomy via custom php print statements in a node-.tpl.php and using values from dsm()
I have entered print statements along "print $node->taxonomy[**]-->name" and it worked for only individual cases because each term is stored in a different array ("**"). This is weird and clunky. Is this a bug or is this the issue discussed in the readme section?
My taxonomy vocabulary had three terms state->city->county so in essence only three arrays should be used. I believe HS is creating arrays for each term. I would like to have one generic print statement that would print the correct values based on each unique node.
How can I programatically print values? Be advised I am no PHP whiz.
Comments
Comment #1
Stomper commentedAnyone with experience with printing content from a hierarchical select enabled taxonomy on a custom .tpl via PHP print statement?
Thanks
Comment #2
Stomper commentedI made some progress after reading the included README. It provides code to print the lineage, but I am looking to be able to print each term separately from the lineage.
Current output using the README code is:
Location: state>county>city
I would like to print:
State: state
County: county
City: city
How can I do this with my node.tpl.php
_________________________
from README::
Sample usage (using Taxonomy and Hierarchical Select Taxonomy):
print theme('hierarchical_select_selection_as_lineages', $node->taxonomy, $config);endif;______________________
Comment #3
Stomper commentedSomeone must've attempted to print individual terms from a lineage, how did you do it?
Comment #4
Stomper commentedTips appreciated, I am just trying to print individual terms from a lineage on a node-.tpl.php. The readme instructs on printing entire lineages, I'd like to break down the lineage into parent-child etc, and print them separately.
Comment #5
virtualdrupal commentedThis might require some adjusting and isn't as clean as you were looking at doing, but hopefully it helps
// Called in theme with vocabulary id
Comment #6
virtualdrupal commentedI've only used it two terms deep though, so it may need adjusting if you're doing 3
Comment #7
stefan.r commented6.x issue without activity for over 3 years, closing.
Please reopen if this is still an issue in 7.x.