Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Mar 2010 at 12:24 UTC
Updated:
27 Mar 2010 at 09:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
dawehnerYou could try to hook_form_alter and check for the formid ctools_jump_menu
Comment #2
brunodboYep, indeed. .. thanks.
Comment #3
brunodboComment #4
brunodboIf anyone else is looking to do this:
Comment #5
merlinofchaos commentedJust to confirm yes, there is intentionally no tpl for the jump menu, because it would be more or less empty -- everything is processed by the form and it would just output one variable.
Comment #6
brunodboThanks.
As an improvement to #4:
will replace the jump menu's default '- Choose -' option with your own selected option (having a value of "" in the select box).
Comment #7
merlinofchaos commentedI seem to recall that the underlying Jump Menu code allows the text for the '- Choose -' to be sent in via function in CTools. If this is true then it would be trivial to add an option in the UI for this.
Comment #8
brunodboSomething like this?
Attached patch adds a text field to the jump menu configuration UI, to supply the text for the 'choose' option. The value is then passed in the render() function and is displayed as the selected option in the select box.
Comment #9
brunodboComment #10
merlinofchaos commentedNeed to add the choose field to the option_definition() for the style or it won't get stored properly in 3.x. Otherwise this is good, I think.
We should probably also just default it to '- Choose -' (set it translatable) and that way it's easy for the user to see what will be used.
Comment #11
brunodboUpdated patch attached.
Comment #12
merlinofchaos commentedOh wow. That - Choose - shouldn't be in t() (which highlights a bug -- the 'Go' above it also should not be in t(). That means those items will get double translated. That's never good.
Comment #13
brunodboAh yes, that makes sense :)
Fixed the t('Go') bug as well (hope it's ok to do this in one patch?).
Comment #14
merlinofchaos commentedCommitted to 2.x and 3.x in D6. Since the jump menu hasn't made it to 7.x marking for porting
Comment #15
dawehnerAnd ported