Exposed filters are a bit more flexible than arguments so being able to use them with Views Field View would be great.
I wrote a patch that adds an option for an exposed filter query string, similar to the current argument option. It works for me on Views 2.x, but haven't tried it on Views 3.x - perhaps it might need some adjustments to work.
A nice use case for this: Add a CCK Textfield to a node type and let users save a filter query string. Use the token for that field as the value of the filter query string for a Views Field View and you will have a a kind of dynamic node references.
Issue fork views_field_view-966478
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
voxpelli commentedBetter patch - this one actually supports tokens in the exposed filter data and handles empty filter data correctly with fallbacks on the default values of the exposed filters.
Comment #2
voxpelli commentedCan I do anything to aid anyone in reviewing this issue? Is the patch too big or the use case hard not justified enough?
Comment #3
tizzo commentedYour description makes sense to me and I think the use case seems reasonable, just haven't had time to review and test.
Assigned to me and I'll try to hit it up this week.
Comment #4
imclean commentedHere's an attempt at a D7 version but I'm not sure it's correct.
For the "urlencoded list of values" under "Exposed form" I've used the following:
However, the results of the second view aren't being filtered by it, all results are being displayed. I've also tried creating a filter for the same field within the second view, both exposed and not exposed.
Still trying to get my head around Views in D7, is the code in the patch incorrect, or am I confused about how this feature should work? Or both?
Comment #5
imclean commentedMistake in the patch, try this one.
Comment #6
enap commentedWas this ever rolled in or a separate module created? I need to be able to pass the value of the master view's exposed filters to the child views.
Patch doesn't apply successfully to latest -dev snapshot.
Comment #7
imclean commented@enap, any update to this issue would be here. You could try manually applying the changes in the patch and uploading a new patch.
Comment #8
enap commentedEDIT: Manually applied the patch again, no errors this time! I've got the 'exposed filters' field on the view_field field, however not entirely sure what input its expecting?
EDIT: Think I need my eyes checked :).
Comment #9
imclean commentedThere's a problem here:
The second line doesn't take into account there may not be a view to work with and will produce an error. This can occur when using tokens as arguments and the parent view has no results.
Comment #10
leramulina commentedIs there any patch for Drupal 6 version?
Comment #11
bennos commentedPatch in http://drupal.org/node/966478#comment-5306058 does not work with the RC3 or the latest dev.
changing the status to needs work
Comment #12
damiankloip commented@bennos, the patch will probably need to be re rolled. It's quite old and alot has changed on the 7.x branch since then.
I guess the status can be needs work, as there is a patch.
Comment #13
rbrownellHas there been any movement on this? I really need this functionality.
Comment #14
vasrush commentedIf you add the same exposed filter (with the same identifier) to the child view, it works.
No need for a patch to make it work this way.
Optional you can hide the second exposed filter with css.
Hope that helps
Comment #15
jenlampton@vasrush that's only true if you are working with a page display, or are on a page where the exposed filter values are in the URL. If you are working with a panels content pane where exposed filters are used as pane config, or a situation where you are using ajax, then using the same exposed filter with the same key is not going to cut it, unfortunately.
Comment #16
jenlamptonThe attached patch provides a new approach to passing along exposed filters. A single checkbox is provided in the UI now. It will cause the child view to inherit the same values that are present on the parent, but that child view will need to have the appropriate filters added, and exposed.
Comment #17
dobe commentedI added to patch #16. It not only allows you to inherit by checking the "Inherit exposed filters". It now allows you to select the values as if you were using the exposed filter form.
Comment #18
bhosmer commentedWith #16, I get the exposed form in my field instead of the data for the view.
#17: I can see the new functionality on the views field settings form, but I don't see anywhere to add the particular exposed filter. I also still only see the exposed filter in my table instead of the data itself using the exposed filter.
Comment #19
dobe commentedYou must add the exposed filters to the view your adding via the view field (not the view your having the field on). Then you should have them show up on the view field settings form.
I am using it and it works pretty well. I haven't had any problems yet.
Comment #20
bhosmer commented@dobe: I've done that.
My "master" view has two exposed filters, and then the view that I am including has the identical exposed filters.
With #17, I don't see any filters to select in the ui to include.
Comment #21
dobe commentedAhh. I think its an issue with the display being master. I will look at trying to update this when I have a moment to make sure it supports the master display.
Comment #22
misterpo commentedHi,
I have tried both patches #16 and #17 with Views 7.x-3.13 and Views Field View 7.x-1.x-dev.
None of them seems to work.
What is the status of this feature request ?
If it is solved, is it possible to get clear instructions on how to setup these exposed filters ?
Many thanks in advance.
Comment #23
viveksr2 commentedIs this working for anybody?
I am having same scenario where i need to display a view with each row of another view, but i am not able to make common exposed filters work together.
Any help is appreciated!! :)
Comment #24
Azor Ahai commentedI'm Having the same issue as #20. Can somebody please provide an update on the issue? This kind of functionality will really make this module robust.
Comment #25
Azor Ahai commentedIs anybody keeping up with this module anymore?
Comment #26
ashumateDrupal commentedI am seeing the option, but the exposed filter is not filtering the content. Any ideas on this one? Same issue as the ones posted above.
Comment #27
rgnyldz commentedI also see the filters inside the inner view but the filters seem to take no affect with ajax.
I have the views inside a megarow kind of place so I need them to use with ajax.
Comment #28
lucasantunes commentedI support this request. I'd also like to ask if it's already being tracked for D8.
I have a case scenario where, in D8, I'm using 3 View fields inside a view, and one of them has a Language exposed filter. I'd like to propagate this language through from the first view to any other one, so that whenever I need to I can get the sub-views in the correct desired language.
For now, I believe my only alternative is to use contextual filters for this, but I'm looking forward to seeing it working on this module!
Cheers,
Lucas
Comment #29
lind101 commentedThis is still an issue on the 8.x.1 branch. Switching version, can be back ported later.
Comment #30
lind101 commentedThere is a decent enough work around in D10, whereby as long as the filter identifier you are trying to inherit is the same on the field View as the parent View the value will be picked up and applied.
For Ajax enabled Views I have coupled it with Views Ajax History module in order to keep the URL parameters up-to-date.
This combination seems to be working well in D10.
Comment #31
vladimirausThank you for your contribution.
Drupal 7 is no longer supported.
Closing this issue as outdated.