While navigating using jump menus, once the page finishes loading, the jump menu returns to it's default state. It might be good to retain the current users location so they know where they are. (i.e. instead of --Select destination-- the jump menu stays at 'Home' or 'About Us')

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

doublejosh’s picture

Status: Active » Postponed (maintainer needs more info)

Had been thinking about this.

Should the "select a destination" be removed in this case?

doublejosh’s picture

Title: Retain last selected menu item » Retain previous choice as "selected" menu item

change title

pixelsweatshop’s picture

I suppose this issue is coupled with this one #1504514: Utilize block title instead of --Select desitation-- and really depends on what is implemented there. And I guess providing the site builder with these options in your future Admin UI might be the best option. Once again, making very few assumptions of what they want and just providing them with the options to do either on a block by block basis.

doublejosh’s picture

Issue: if they have not yet made a choice, but the select list is set to the current page, it's not obvious what the select list is.

pixelsweatshop’s picture

That's a good point. Maybe my suggestion is over-complicating something that is already very usable and intuitive for end-users

doublejosh’s picture

I think one of the other modules does implement this. It would probably need to be an option per menu.
Linking to admin UI: #1251264: Admin Interface

doublejosh’s picture

Priority: Normal » Minor
doublejosh’s picture

Status: Postponed (maintainer needs more info) » Postponed
Cyclodex’s picture

Hey
First I want to say nice module, exactly what I searched for.

I just came over the same issue for my project. The select field has some navigation links, but after switching to the page, the select field just has the first item selected (in my setup there is no select text or similar).

The problem is then not only that it does not look correctly, it is also no possible to switch to this item any more. But doesn't matter, its anyway not the way I wanted it to have.

Because I also played around with the views jump menu, I searched for the code where it is selecting the correct page (there it works nice).
Here is the related code of the views plugin: LINK to API

So for my project this code worked well, perhaps you can implement this as an option or similar, if you don't want to make this a default behaviour.

Hope this is helps you too:
jump_menu/jump_menu.module near LINE 48

    // Place initial select option value. 
    $options['choose'] = t($choose);

    // -- start of change -- //

    // Pre-select current page 
    $current_url = url($_GET['q']); 
    if (!empty($current_url)) {
        $options['default_value'] = $current_url;
    }

    // -- end of change -- //

    // Other available options...
    ....

Let me know what you think about that and if it works for you!

I can create a patch if you like, when I have some more time.

Cheers Cyclodex

Cyclodex’s picture

Status: Postponed » Needs review
FileSize
552 bytes

And here is the patch against current dev.

valderama’s picture

Thanks for the patch! It applied cleanly also to 7.x-1.4

Also I discovered no problems so far.

Cyclodex’s picture

cool!

@doublejosh
What do you think ? Can you try it out and if fine you could commit that patch.

codenamerhubarb’s picture

I can also confirm the patch in #10 has solved the problem for me in 7.x-1.4. Thanks!

doublejosh’s picture

Status: Needs review » Needs work

This really needs to be an admin option per block.
In the case that a page is landed on from organic search or outside using the drop down it would be confusing not to see the "Please Choose" message.
I see this more of a preference and definitely not appropriate in all cases.

Happy to add a patch including admin option!
Sorry don't have the time at this moment.

jami3z’s picture

Not working for me, does this only work if using the supplied jump menu blocks? I've inserted mine using the code supplied and the list defaults back to the "-select-" option.

cheers

Cyclodex’s picture

What values do you have in your options and what is your url?
$current_url = url($_GET['q']);

You can also try to debug this with some dpm() calls in the code.

Do they match ? (one option should match)

Cyclodex’s picture

@doublejosh
True, but I am also really busy :)

doublejosh’s picture

Priority: Minor » Normal
doublejosh’s picture

BTW: There another patch here too.
#1997382: Display selected item

Really want to wait and have this be config since some use cases wouldn't want the current item selected.

doublejosh’s picture

Status: Needs work » Needs review

Have this in the dev branch now. It's a configurable option on block edit. Pretty please test this.
http://drupalcode.org/project/jump_menu.git/commitdiff/9f217a5?hp=542ac2...

May want to store the data differently than this first go round. Note that putting this on a live site might mean having to update the block settings again later.

doublejosh’s picture

Status: Needs review » Fixed

Will be in next release.

doublejosh’s picture

NOTE: If you used this dev feature, when upgrading to 7.x-1.5...

You will need to RESAVE all blocks with this set.

The data storage is being updated to allow many settings per block.

Status: Fixed » Closed (fixed)

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

wooody’s picture

Thank you..