The Views 6.x-2.7 release notes mention a new "jump menu" feature, but I can't find documentation anywhere. What is this? How does it work?

The Jump module maintainers are wondering, too: #610116: Views integration

Comments

dawehner’s picture

Category: bug » support
Status: Active » Fixed

* A jump menu is a select box and an optional 'go' button which can be removed
* if javascript is in use. Each item is keyed to the href that the button
* should go to. With javascript, the page is immediately redirected. Without
* javascript, the form is submitted and a drupal_goto() is given.

See includes/jump-menu.inc of ctools for more informations.

aren cambre’s picture

Title: What is a "jump menu"? » Please document "jump menu"
Category: support » task
Status: Fixed » Active

Needs to be openly documented at drupal.org.

merlinofchaos’s picture

Status: Active » Closed (won't fix)

/me rolls eyes.

evoltech’s picture

Status: Closed (won't fix) » Active

See includes/jump-menu.inc of ctools for more informations.

This file does not exist in any of the branches I can find of ctools. I do see that there is a few files with 'jump' in the name in the views repo: ./plugins/views_plugin_style_jump_menu.inc
./plugins/views_plugin_style_summary_jump_menu.inc

Please advise.

marcp’s picture

Status: Active » Closed (won't fix)

includes/jump-menu.inc is in the DRUPAL-6--1 branch of ctools.

DocMartin’s picture

Just found Jump Menu among style options in Views.
Thought I'd give it a try.

Selecting jump menu as display, I see
"To properly configure a jump menu, you must select one field that will represent the path to utilize. You should then set that field to exclude. All other displayed fields will be part of the menu. Please note that all HTML will be stripped from this output as select boxes cannot show HTML."

In fields for View, I've tried selecting Node:Link, and excluding this from display. No matter whether I choose to output this as link, with [Node_view] as code, or don't check output as link, the jump menu takes me to a non-existent page with URL /view

- I'd also tried the more obvious Node Title, linked to Node, as field. Use this to create more mundane menus, but not working w jump menu. Tries to visit page with title as URL.

Tried a few things, like - in jump menu options - grouping fields by title; in Fields - setting Node Title above Node Link.

So I've done something, but not functional... yet.

Wonder re jump menus and SEO/search engine robots - will search engine spiders see and follow the links?

... not rolling eyes. More a wry laugh

merlinofchaos’s picture

You want to use a link like node/[nid] rather than the Node: Link functionality.

The Node: Link field generates a link: i.e, view

When translating that to a destination, the HTML is stripped and you are left with 'view'. I realize this isn't completely intuitive, because you are expecting to get the URL that it is linking to, but that is unfortunately not what Views sees.

DocMartin’s picture

Ah, that explains why I jumped to /view

The pages I want to link to have URLs built with [term-raw]/[title-raw] (Pathauto)

Can't see how to create a field that will include this, and will create the URL for Jump to use.

Node:Link looks possible, but I've tried putting [term-raw]/[title-raw] into "Rewrite the output of this field" box - so Views might not see it as a regular link, but no joy; noticed that only have few choices as substitution patterns, and also tried the [view_node] in this box field.

Presumably, Pathauto tokens not processed here.

But I've also tried node/[nid] - if in "Rewrite the output of this field" box, I get taken to URL with /node[nid] (no subsititution)
If node/[nid] into rewrite as URL, again to /view

Maybe there's a field type that I'm overlooking; or maybe a field type that Jump Menu can use would be handy.

clemens.tolboom’s picture

imho Jump Menu is a little bonky. It took me a while until I read in #7 "HTML is stripped" ... meaning the 'normal' output of the field is stripped and so the text value is used as the "link to" you must make sure it starts with a '/'

1. use Node: nid
2. Rewrite the output of this field
3. Enter "/node/[nid]"

or

1. Use Node: path which contains a "/" at the start.

Make sure to reconfigure Jump menu style to use the correct field.

As a last step "Exclude from display" that field.

amitaibu’s picture

Status: Closed (won't fix) » Fixed
StatusFileSize
new2.71 KB
new26.34 KB

Attached a screenshot that shows the configuration of the view, and its export.

Note that we exclude the Node:NID from the View, and rewrite it's output.

caponey’s picture

I did what Amitaibu said, and it worked. Except....only if I use it from the front page. If I select a link from the menu on anywhere but the front page, it takes me to a page not found.

dawehner’s picture

Status: Fixed » Active
Issue tags: +Novice

What about marking this as novice documentation task.

iamjon’s picture

Assigned: Unassigned » iamjon

I'm assigning this to me so I can take care of it.

bandelier’s picture

This *almost* works for me - but I don't want the selection to go to the node page - I want to control where this goes, as it is a step in my registration process - if the user selects from one of the drop-down options, I want them to be directed to another page (/user/registration) vs. a content profile registration page.

Would be nice if this had better documentation and was more flexible with its options - if the only option is to go to the nid, then why not just hard code that into the jump page logic instead of making people wander around trying to discover these settings?

merlinofchaos’s picture

You select a field that represents the destination. You are not limited to nid at all.

bandelier’s picture

I tried to add a general link by using "Global -> Custom Text" for the link - this did not work. When I tried to circumvent the nid by excluding from display, choose "Rewrite the output of this field", then add the path "/user/register/%page", I only get a single response back in my drop-down list - yet I should have 400+ results from the query. Unless someone has another trick, this does not work unless you want to link back to the node.

merlinofchaos’s picture

Status: Active » Fixed

/user/register/%page

What is %page? %page is not a token Views understands, that's for sure. I'm not at all sure what you're expecting it would be, either.

It appears that you're assuming some kind of data will be there and when it doesn't work, blaming Views for it not being there.

merlinofchaos’s picture

Note that one possible hiccup here is that the way the jump menu works, each item in the list must have a unique destination. Having several links that all go to the same location will fail exactly as you have described.

bandelier’s picture

Status: Fixed » Active

%page is simply a placeholder for a custom registration page. the jump menu serves a single purpose, seemingly. would be nice to have "compliant" form processing that would use the form action instead of individual node/item action. guess i expected too much.

merlinofchaos’s picture

Status: Active » Fixed

expected/assumed too much. The jump menu sets a destination per item. That's the whole point. Trying to use it as a general purpose form with a single action is completely not its intent.

bandelier’s picture

Status: Fixed » Active

would be nice if that "intent" were documented somewhere instead of making people run around in circles.

merlinofchaos’s picture

Status: Active » Closed (won't fix)

Would be nice if users would stop treating the authors of software they get for free with sarcasm and derision because things don't work exactly the way they expect or want.

bandelier’s picture

not my intention, and apologies if that's how it came across. just going through a rough patch while attempting to find a solution to a very specific issue that has my noggin tied in knots. trust me - if you're developing anything on Drupal, you're light years ahead of me in terms of ability and knowledge. next step for me: buy book, learn APIs and stop whining.

bandelier’s picture

p.s. i did find a non-views way of doing this via a straight sql query in a block/page or what have you for anyone else who is looking:

http://drupal.org/node/353292

echo $PHP_SELF " method="post">
$title = db_query(db_rewrite_sql("SELECT title FROM {node} n WHERE type='course'"));
while ($row = db_fetch_array($title)) {
  $course_title = $row['title'];
  echo "<option value='$course_title'>$course_title</option>";
}


merlinofchaos’s picture

That's probably a better option than trying to use Views for it. Sometimes some things just require writing the code to do it.

marcp’s picture

Version: 6.x-2.7 » 6.x-3.x-dev
Assigned: iamjon » Unassigned
Status: Closed (won't fix) » Needs review
StatusFileSize
new4.16 KB

After that exchange, I hesitate to re-open this, but here's a patch to add some jump menu words to the advanced help. Patch is against DRUPAL-6--3.

jrabeemer’s picture

+1 to #26

I finally got this jump menu working after many tries. It is definitely not intuitive or self-evident to use unless you use the steps outlined in the patch above.

Sjarsena’s picture

+10,000,000 #26

After a whole day of trying different things finally I got this working. That patch is awesome just follow those directions really really helped do what I needed.

Thanks marcp

dawehner’s picture

Assigned: Unassigned » esmerel

Assign to esmerel for review.

parasox’s picture

How can I get a Jump Menu to work with Taxonomy Terms? I want to put my categories into a jump menu dropdown, but it doesn't link to the right place as above. However they're not nodes, so the above instructions don't work for me. Any info appreciated! I did check the patch but nothing re: taxonomy in there.

iamjon’s picture

parasox,
Please open a new thread or review the patch that was listed here.

esmerel’s picture

Status: Needs review » Fixed

committed patch to 6.x-3.x

Status: Fixed » Closed (fixed)

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

eridolfi’s picture

subscribing