There is an issue over in #1175260: Jump Menu requires unique paths which talks about a problem with Views not being able to include multiple items within a jump menu that point to the same URL. In that issue, there is a proposed solution which requires an adjustment to ctools to make it workable. Basically this checks the url to see if it is in a special format unique-id::url
, and if so then it just uses the url part to perform the redirect. This allows one to include options like the following.
md5hash1:http://www.example.com/page
md5hash2:http://www.example.com/page
md5hash3:http://www.example.com/page
3 options that point to the same URL. ctools handles stripping out the prefix and ensuring that the correct URL is redirected to.
These is also a patch in the aforementioned Views issue which adds support for this new syntax to the views jump menu plugin.
Comment | File | Size | Author |
---|---|---|---|
#17 | 1224340-17-d6-jump_menu.patch | 2.01 KB | mikeker |
#12 | 1224340-d6-backport-with-comment-8.patch | 1.84 KB | d.clarke |
#5 | 1224340-d6-backport.patch | 1.8 KB | jrust |
#1 | 1224340-ctools-jump-menu-prefix.patch | 1.96 KB | mrfelton |
Comments
Comment #1
mrfelton CreditAttribution: mrfelton commentedComment #2
merlinofchaos CreditAttribution: merlinofchaos commentedOh, this is a kind of a neat solution. I definitely hadn't considered anything like it!
Comment #3
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted to D7. Doesn't apply cleanly to D6, needs a backport.
Note: The patch contained some whitespace that I fixed manually. They're hard to see, but luckily git warned me about them. Plus, there was a missing space after a ,
Comment #4
jrust CreditAttribution: jrust commentedsubscribe
Comment #5
jrust CreditAttribution: jrust commentedBackported for d6.
Comment #6
dagmarIt works fine. Apply the patch using -p1
Comment #7
monotaga CreditAttribution: monotaga commentedThe patch in #5 works for me on D6, too. Can we get this committed? (Without this patch, jump menus in Views 6.x-3.x-dev don't work correctly unless if you modify views/plugins/views_plugin_style_jump_menu.inc.)
Comment #8
ktha CreditAttribution: ktha commentedThe patch #5 seems to be missing the following line at the end of ctools_jump_menu_submit():
Comment #9
monotaga CreditAttribution: monotaga commentedktha, I'm using the patch fine without that extra line. What's your use case that you're finding that line necessary? Want to submit an updated patch?
Comment #10
TimeBandit CreditAttribution: TimeBandit commentedFYI, this patch was NOT included in the recent (August 2012) 6x-1.9 update. Had to patch again on update. This patch does resolve the issue for me.
Comment #11
broncomania CreditAttribution: broncomania commentedI agree patch 5 works and is missing on the 6x-1.9 update. Please include this patch in the next version.
Comment #12
d.clarke CreditAttribution: d.clarke commentedAttached is a re-rolled patch that combines comment 5 and 8. The change from comment 8 was needed to fix the issue in my case and it makes sense since without it the ctools_jump_menu_submit() code is setting a variable that'll never get used.
Comment #13
TimeBandit CreditAttribution: TimeBandit commentedPatch works for me.
Note previous patch was not included in 2012-Nov-14 6.x-1.10 update.
Comment #14
merlinofchaos CreditAttribution: merlinofchaos commentedTimeBandit: Yes, that's why the issue is marked 'needs review' and not 'fixed' or 'closed (fixed)'.
Comment #15
jelo CreditAttribution: jelo commentedWhat is needed to get it committed? It appears that several community members have tested it and state that it works fine. Given that the views patch was committed in 2011 which adds the hash to the redirect URL, delays in committing this ctools patch actually break the whole style.
Comment #16
mikeker CreditAttribution: mikeker commentedVerified #12 works with Views 6.x-2.16. I would assume this works with the 3.x branch as well as it's client-side processing.
Just a note for those that don't read the entire issue, the path field needs to be rewritten in the form of
some-unique-id::destination-path
for this to work correctly.Thanks, mrfelton!
Comment #17
mikeker CreditAttribution: mikeker commentedWhoops... Take it back. I needed to add a
decodeURIComponent()
to make it work.Comment #18
TimeBandit CreditAttribution: TimeBandit commentedThanks for new patch. #17 works for me.