i would like to set the first default dropdown-item manually. like a title of what to choose.

thank you,

nils

CommentFileSizeAuthor
#9 dropdown.jpg8.19 KBolegnaumov

Comments

olegnaumov’s picture

yeah, me too..

maybe it can be done with some php snippet?

marcp’s picture

You can do this now, if you call the jump_quickly() function from a PHP snippet like this (for taxonomy):

<?php
  $options = array();
  $options['/'] = t('Choose one of these items');
  jump_menu_get_taxo_items($options, 'term-name');
  print jump_quickly($options);
?>

Substitute jump_menu_get_menu_options() for jump_menu_get_taxo_items() if you want to do this for a menu.

And, you can always do this with a custom options array that's passed in to jump_quickly(). The only minor hitch is that the user can hit the OK button when the initial item is selected, in which case they'll get sent to the path you put in there (in the example above the path is the site's home page).

olegnaumov’s picture

marpc, I get this error:

Fatal error: Call to undefined function jump_menu_get_taxo_items() in …\includes\common.inc(1473) : eval()'d code on line 4

I'm using Drupal 5.17, any thoughts?

marcp’s picture

Are you calling that function from a block? If so -- can you confirm that the Jump module is activated at admin/build/modules?

olegnaumov’s picture

Version: 6.x-1.x-dev » 5.x-1.1

Are you calling that function from a block?

Yes!

If so -- can you confirm that the Jump module is activated at admin/build/modules?

Of course! :)

I have two blocks and they are perfectly working...

Changing “Version” to 5.x-1.1

marcp’s picture

@olegnaumov - so, i can't tell, are you still having a problem?

olegnaumov’s picture

marcp,

Yes, i have. My last post is confusing, sorry.. What I meant is that module is installed, everything works fine. But when I try to use a new block which contains the code you provided (http://drupal.org/node/298588#comment-1551984) — I get fatal error: Call to undefined function jump_menu_get_taxo_items()

marcp’s picture

What happens if you leave out the line that calls jump_menu_get_taxo_items()? Do you get a short jump menu in your block?

olegnaumov’s picture

StatusFileSize
new8.19 KB

Yes! I get short jump menu.

olegnaumov’s picture

Status: Active » Closed (fixed)

Ok, I guess I figured it out, it works for me!

Here is the code:

  $options = array();
  $options['/'] = t('Choose one of these items');
  jump_menu_get_taxo_options($options, 12, 'taxo');
  print jump_quickly($options);

Where «12» is a vocabulary ID.

Thanks!