I know this isn't directly HS related, but thought some HS users might have had to solve this problem.

I save the term lineage so my nodes have something like this:

Submitted in: Cook County United States Virginia

so they are being printed, in alphabetical order with no styling, whereas I would like something like this:

Submitted in: United States >> Virginia >> Cook County

largest to smallest, with any styling/formatting between them that I'd like.

how would I manage that? I would need to break up the $terms variable into its component parts, wouldn't I?

Comments

wim leers’s picture

Assigned: Unassigned » wim leers
Status: Active » Fixed
jrbeeman’s picture

You can also take a look at the code I have in the Taxonomy Search module that generates the search results. See theme_taxonomy_search_item() in the 5.x branch. That should give you some decent sample code to build off of.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

drupalina’s picture

Version: 5.x-3.x-dev » 6.x-3.6
Component: Miscellaneous » Code - Taxonomy
Status: Closed (fixed) » Active

Hi,
I looked at http://api.drupal.org/api/function/hook_link_alter/6 and the HS API and the code in Taxonomy Search module, and still can't get my head around how to print taxonomy terms in a given vocabulary in the order of their hierarchy. I'm reopening this support request in 6x because this is very relevant to the very concept of HS -- if the end-users select hirarchically then they would naturally expect to also see a hierarchical output. And there is no documentation at all on how to achieve this. Please help.

drupalina’s picture

Okey -- I found an unexpected solution through this module http://drupal.org/project/tagorder
Seems to work okey with HS.
It saves the lineage of the hierarchy of the hierarchicalised taxonomy terms and prints them as such. But still doesn't print ">>" between them to indicate that there is a hierarchy between those terms. Maybe this is something that HS module should do, no?

wim leers’s picture

Status: Active » Closed (fixed)

It's NOT nice to make duplicate posts: #941096: How to print only the last 2 levels of the selection.

And DEFINITELY not to reopen ancient issues.

drupalina’s picture

Sorry WimLeers - I didn't mean to anger you!
I just wanted to share the solution that had been tormenting me for the past 4 weeks in case that other non-coders (who can't make heads or tails of the code in the readme.txt) would bump into this in the future.
What lesson am I to extract from this: keep my solutions to myself and don't share? What would happen to Drupal if that was the ethos?

rol’s picture

thanks Drupalina,
i was looking for last 2 hours any slution about the exactly same ISSUE,
my problem was the same, how to control how HS with SAVE LINEAGE, add terms at $term array, cause it seems ( in my case ), it's kind of RANDOM and of course, after when u want to show a specific term to end user, is not an easy solution.

so, don't know if there's anyothr threat about it, but i found you first.
i'll post if your solution solves my problem!

thanx

ivoo56’s picture

Thanks for posting this drupalina!