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

Comments

marcp’s picture

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.

cmgui’s picture

hi marcp

it works!

thank you.

gui

2ndChanceTech’s picture

subscribing, and verifying this works as described.

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

scottrigby’s picture

Status: Active » Needs review
StatusFileSize
new650 bytes

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 :)

seaneffel’s picture

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.

gooddesignusa’s picture

Thanks Scott. Patch worked for me.

nicholas.alipaz’s picture

Version: 6.x-1.0 » 6.x-2.x-dev
Status: Reviewed & tested by the community » Needs work

This feature didn't get into 1.x. We are glad to accept a new patch against 2.x branch.

nathan573’s picture

Here is my version of jump_menu_get_taxo_options, which takes the top level taxonomy items and makes groups out of them to contain their children:

 function jump_menu_get_taxo_options(&$options, $vid) {
   $tree = taxonomy_get_tree($vid);
   foreach ($tree as $term) {
     if (!$term->depth)
       $option_group = $term->name;
     if ($term->depth)
       $options[$option_group][taxonomy_term_path($term)] = str_repeat(' ', $term->depth) . $term->name;
   }
 }
jasonawant’s picture

@nathan573,

Thanks for posting this snippet to the issue queue. For taxonomy vocabularies without any parent terms, the jump menu does not display any options.

I also noticed that when using this snippet and selecting a jump menu, it triggers the admin menu to expand.

I'll post back if I solve anything.

Thanks, jwant.

vaccinemedia’s picture

Would it be possible for a similar function/ feature to exist for the hierarchy of normal menus too so that the second level links are visible?