Closed (fixed)
Project:
Hierarchical Select
Version:
6.x-3.6
Component:
Code - Taxonomy
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
16 May 2008 at 10:01 UTC
Updated:
15 Dec 2011 at 19:30 UTC
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
Comment #1
wim leersPlease see http://api.drupal.org/api/function/hook_link_alter/5.
Comment #2
jrbeemanYou 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.Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
drupalina commentedHi,
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.
Comment #5
drupalina commentedOkey -- 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?
Comment #6
wim leersIt'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.
Comment #7
drupalina commentedSorry 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?
Comment #8
rol commentedthanks 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
Comment #9
ivoo56 commentedThanks for posting this drupalina!