Closed (fixed)
Project:
Hierarchical Select
Version:
6.x-3.6
Component:
Code - Taxonomy
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
14 Oct 2010 at 02:15 UTC
Updated:
29 Oct 2010 at 11:10 UTC
Hi WimLeers,
I remember bumping into a support request in HS issue queue that asked how to hierarchicaly relate several different fields. And you advised him/her to create a single vocabulary and arrange taxonomy terms within it hierarchically, so as to use HS. That is what I've done.
So in my content profile creation form I have the following HS taxonomy tree:
Country >> Region >> City >> Company >> Division
But all of these print as taxonomy terms and the first 3 levels are pretty confusing. So I would like to print only the last 2 levels: Company >> Division
How can I do that???
Thanks in advice - I'm sure many others will find the solution posted here useful.
Comments
Comment #1
wim leersIt's documented. README.txt, the "Rendering hierarchy lineages when viewing content" section.
Comment #2
drupalina commentedLets's say I want to print Company >> Division at the begning of the node, and then Country >> Region >> City at the end of the node.
The readme.txt code doesn't answer how to print only the last 2 item or the first 3 items in the lineage. It only tells us how to print the lineage. And that's why I posted this Support Request.
The code, which I presume we should put in node-nodetype.tpl.php needs some sort of DELTAs or something like that. No?
And my question was -- what kind of code should we put in the code above, in order to make it print the last 2 items or the first 3?
And this is not documented and it should be IMHO -- at least in this forum, so that others facing a similar problem can Google for it and find a solution.
Comment #3
wim leersThis is not a forum, this is the issue queue.
If you want to print just the last two levels, then create your own theme function, but start from theme_hierarchical_select_selection_as_lineages(). That's how it works in general in Drupal :)
Comment #4
drupalina commentedthanks for the pointer ;)