Currently you simply can't have exposed filters on a block as long you don't have ajax enabled.
The problem is that exposed filters need a path, though blocks don't have one.
The goal is to add a new checkbox which allows to enable exposed filters on blocks but just use the current url as the path of the form.
This checkbox should have a detailed explanation why you maybe not want this and you absolute know what you are doing etc.
I'm not sure whether this task can really be seen as "novice" task, though it's a really helpful feature for some users.
Please post a comment if you plan to work on this issue and assign the issue to yourself.
Comments
Comment #1
Fidelix commentedAfter having a conversation with Dereine and solving some doubts on IRC, I'll try to create a 2 patches:
Patch 1 - Small and good enough to go in: it simply removes the limitation and uses the current URL as the path for the exposed block. It also presents a warning checkbox.
Patch 2 - Allows the user to set the path of the display INSIDE the display's "Exposed form options", for any kind of display.
Comment #2
Fidelix commentedHere is patch 1. Needs tests.
If it works, I will clean it a little more and create Patch 2.
Comment #3
Fidelix commentedOpera and d.o file uploads don't like each other...
Comment #4
dawehnerLet's keep it for the moment but return TRUE all the time, by default, maybe there are displays which definitive shouldn't have this feature and additional removing a function maybe breaks some custom/other contrib code, you never know.
This is kind of confusing, wouldn't it be possible to just wrap the code with an if(...)
Thanks for working on this patch!
Comment #5
Fidelix commentedAbsolutely.
Like this?
Or would you prefer it like this?
Comment #6
dawehnerThe second one seems to be a bit easier to understand.
Comment #7
Fidelix commentedRevised patch.
Comment #8
dagmarRemove this.
Also remember to change the status to 'Needs Review' every time you post a new patch.
Comment #9
Fidelix commenteddagmar, thanks for remembering.
I had the intention to remove this after someone tested it. But I will do so now.
Comment #10
Fidelix commentedHere it goes. Simply removed the dpm() line.
Comment #11
dagmarMmm. This shouldn't be removed. This dpm is part of the view_debug function.
Comment #12
dagmarAlso, the strings used in
'#title' =>and'#description' =>cannot be translated at this momment. Wrap the strings using the t() function.Comment #13
Fidelix commenteddagmar, I only did that so it doesn't add "to-be-changed" strings on people's database.
I suppose that people messing with patches should expect that, hehee. sorry.
Comment #14
dawehnerHere is a follow up issue which really confused me while reviewing this patch: #1444972: Allow displays to decide whether they want to add special blocks
I fear this will break some custom code. Many people use the $view object to set $view->override_url to get the exposed block acting on a certain page. Maybe you could use views_plugin_dispaly::get_path to achieve this behavior.
The rest looks definitive RTBC.
Comment #15
Fidelix commenteddereine, you're right.
I want to leave room for a feature where a user may force and set the block path IF $this->get_option('exposed_block') == 1
Would something like this work?
Comment #16
dawehnerSadly not really. People use both override_url and override_path to override what they need. They still have to work as before, because changing here will for example break afaik commerce, which are 10k installations.
Comment #17
Fidelix commentedHow about this, on views_plugin_exposed_form.inc:
Comment #18
barrapontoIn the meanwhile, can we get a warning telling users that their settings (exposed forms on view blocks with ajax disabled) will not result in the expected behavior? Because this is a recurring issue, we should try to mitigate it while we fix it.
Of course, I'm all for fixing it.
Comment #19
spgd01 commentedA warning would be very helpful
Comment #20
amit0212 commentedTo add exposed form in block follow these step:
1)First add view in page
2)Then add required fields and filters as per your requirements
3)Under Advanced section Look at Exposed Form and set the link to Yes while clicking on Exposed form in block: option and save it.
4)Now goto admin/structure/blocks and see your newly created exposed form block listed under Disable blocks region. Now You can configure it and show on desired page.
Comment #21
damienmckennaFYI the "assigned" field is for indicating that you're actively working on an issue, if you're not actively working on an issue please leave it set to "unassigned". Thank you.