Views 3 Roadmap doesn't say anything about implement exposed forms as plugins.
However I think that if headers, or footers will be plugins, exposed filters should be too. This will allow other modules to define especial exposed filters.
I'm marking this issue as 'need works' beacause it ins't ready. Comments are welcome.
Exposed forms as plugin may help to implement this features
From views 3 roadmap:
Ability to have view not run when no value selected
People constantly ask for this feature, wherein the view will be empty until something has been selected in the exposed filters.
Control of text on 'button'
Paired with a proper translation plugin, this would be a nice little touch.
Own section in UI
To start with, the exposed forms have enough possible settings that they need their own section in the UI so that we can give them their settings. We can intelligently unset this if nothing is using the exposed form or maybe we can require it to be turned on before the 'expose' button shows up on anything.
| Comment | File | Size | Author |
|---|---|---|---|
| #27 | exposed-form-plugin-7.patch | 18.14 KB | dawehner |
| #26 | exposed-form-plugin.patch | 16.94 KB | dawehner |
| #24 | exposed-form-plugin.patch | 16.33 KB | dawehner |
| #22 | exposed-form-plugin-7_2.patch | 20.76 KB | dawehner |
| #20 | exposed-form-plugin-7.patch | 22.8 KB | dawehner |
Comments
Comment #1
dagmarMore code.
This patch allows user to select between "Basic" exposed form and "On demand" exposed form.
The first is the standard exposed form, the second one only display the list if user set a value for at least one of the exposed filters available.
Changing status.
Comment #2
dagmarSome small fix:
I was thinking that maybe this plugin is a possible way to implement: #228510: Exposed Sorts. With this patch, exposed forms can alter the query by using query()
Comment #3
dawehnerWhy not let this be handled by the plugin. There could be perhaps a dynamic submit button, but there shouldn't be this string in the locale_source table.
needs to be removed before commiting the patch.
So currently the submit button value is handled full by the plugin. This would cause currently apply be translated to "foo". And then t("foo") will be called again.
This review is powered by Dreditor.
Comment #4
dagmarThanks dereine:
New patch.
BTW. I'm not sure if this is the better way to obtain an empty text for a view.
What do you think?
Comment #5
dawehnerJust tagging to views 3.x
Comment #6
merlinofchaos commentedDespite a couple of small problems, I'm tempted to go ahead and commit this. This is something I like a lot. Great work!
1) There's a leftover krumo() statement.
2) The option_defaults() is outdated and needs to be pulled from everywhere. Go with the option_definition() pattern used in styles and row styles instead. That is more robust.
3) Let's give the "Exposed" options their own category in the UI. I plan to re-org this stuff a little anyhow.
The fact that we need option_definition as opposed to option_defaults is the only thing preventing me from just committing it now; that's going to be a pain to go back and fix. So let's fix that, then I can commit it.
Comment #7
dagmarI have rebuilt it fixing the items that you have remarked.
Also this patch fixes an small bug in #4, now it is possible define different input formats for "Text On Demand" and "Empty Text"
BTW, I doesn't speak english very well, I'm not sure if "On Demand" is the better name for one of the plugins. Maybe there is another better. Please feel free to change it if know another better.
Comment #8
dagmarPlease, see #228510: Exposed Sorts. I have created a patch that includes this patch and the support for exposed sorts.
Comment #9
merlinofchaos commentedCleaned up a bit and committed. Patch attached because this needs to be ported.
Comment #10
merlinofchaos commentedI think that patch is missing the plugin class files; they'll have to be pulled from the 6.x-3.x branch.
Comment #11
dawehnerHere is the first part. The settings of the exposed forms, are not displayed currently.
The plugins are included in the patch.
Comment #12
dagmarI think that this patch is not based on last commit. This line is different in the repository.
Comment #13
dawehner@Dagmar:
This is part of the current drupal6 _on_demand exposed form plugin. I don't do anything here.
New version:
- Current problem:
Exposed_input is sometimes returns as array() sometimes as $value.
Here is a example view to reproduce this.
Comment #14
dagmar@dereine:
Earl Miles changed the name and some parts of these plugins. Please see http://drupal.org/cvs?commit=287352
Comment #15
dawehnerAh ok. thanks for this information.
Comment #16
merlinofchaos commentedSorry, dagmar admitted he wasn't sure On Demand was right, so I changed it as I worked on it. I also really dislike adding WHERE clauses to the query to force it to produce an invalid result, and instead made sure that there is a way to abort the query by setting a value in the build info.
Comment #17
dawehnerTogether with http://drupal.org/node/652716#comment-2348648 it works as expected.
Its from my perspective rtbr
Comment #18
dawehnerSo here is combined patch with the patch above.
This patch is quite important because there are many many issues which needs this patch
Comment #19
dawehnerUpdated version
Comment #20
dawehnerSome files missed
Comment #21
dagmardereine, please use this patch http://drupal.org/cvs?commit=287352 you are still using the old version of plugins. I.e plugin named "On demand" was replaced by "Input required" in Views DRUPAL-6--3
Comment #22
dawehnerOh, i forgot the remove the other one. As you see in the patch, i have both input_required, but also on_demand
Comment #23
dagmarChange t('Apply') for 'Apply'
This is not necessary, exposed_form_alter will change the label of the button.
pre_execute is never called. See patch: #633482: pre_execute is never called on exposed forms plugins
Should take care of change the label of submit button. This patch seems to be including #635966: Allow exposed form plugins to alter the exposed form however this is not totally complete.
mmm, still "On demand?"
Comment #24
dawehnerChange t('Apply') for 'Apply'
This was part of the original commited version see http://drupalcode.org/viewvc/drupal/contributions/modules/views/plugins/views_plugin_exposed_form.inc?r1=1.1&r2=1.1.2.1
The same answer applies to the next 3 reviews.
The last:
Damn i got confused by the names, i remove the wrong file :)
Updated version
Comment #25
dagmarchange
and I think is ready
Comment #26
dawehnerNext version
Comment #27
dawehnerI missed a render call
Comment #28
dagmarNow works fine.
Comment #29
dawehnerThanks dagmar for the testing and finding bugs again :)
http://drupal.org/cvs?commit=306686