Show hierarchy in the taxonomy terms

cmgui - September 30, 2008 - 19:41
Project:Jump
Version:6.x-1.0
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:reviewed & tested by the community
Description

Hi Marcp

Thank you for coming up with this simple and wonderful module.
Is it possible to make the terms in the pull-down menu show in a hierarchical format.
That is, child terms will have a hyphen '-' in front.
See attached screen shot of the Taxonomy menu from Taxonomy Browser module.

Thank you.

Gui

AttachmentSize
taxonomybrowser.jpg14.1 KB

#1

marcp - October 3, 2008 - 21:36

Try replacing the line in the function jump_menu_get_taxo_options() that says:

    $options[taxonomy_term_path($term)] = $term->name;

with:
    $options[taxonomy_term_path($term)] = str_repeat('-', $term->depth) . $term->name;

...and let us know how it goes.

I'd like to generalize this out and make it easier to theme, but this is a start.

#2

cmgui - October 3, 2008 - 23:03

hi marcp

it works!

thank you.

gui

#3

kryptik - November 16, 2008 - 21:19

subscribing, and verifying this works as described.

It would be nice if the parents could be bolded, currently trying to figure this out.

#4

scottrigby - July 18, 2009 - 22:05
Status:active» needs review

Hi marcp,
It's an old issue - and i often use Quick Menu instead (maybe would be good to merge efforts @ some point?).
Anyway, for now Jump has taxonomy support (unlike Quick Menu)... and the taxonomy list works better with your suggestion in #1
attaching a patch :)

AttachmentSize
jump_315416_tax_hierarchy.patch 650 bytes

#5

seaneffel - July 24, 2009 - 18:08
Status:needs review» reviewed & tested by the community

Confirming that the patch in #4 works like a charm. Correctly filters and displays hierarchical terms in Jump dropdown. You can see the proof in the pudding: http://www.cctcvambridge.org/welcome

Ready to be committed.

I'm about to open up a second issue for adding user prefs on how the Jump menu should be displayed.

 
 

Drupal is a registered trademark of Dries Buytaert.