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.

Command icon 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

voxpelli’s picture

Better 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.

voxpelli’s picture

Can I do anything to aid anyone in reviewing this issue? Is the patch too big or the use case hard not justified enough?

tizzo’s picture

Assigned: voxpelli » tizzo

Your 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.

imclean’s picture

Version: 6.x-1.0-beta1 » 7.x-1.x-dev
StatusFileSize
new4.68 KB

Here'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:

field_name=Value

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?

imclean’s picture

Mistake in the patch, try this one.

enap’s picture

Was 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.

imclean’s picture

@enap, any update to this issue would be here. You could try manually applying the changes in the patch and uploading a new patch.

enap’s picture

EDIT: 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 :).

imclean’s picture

There's a problem here:

        if (empty($view->current_display) || $view->current_display != $this->options['display']) {
          if (!$view->set_display($this->options['display'])) {
            $output = FALSE;
          }
        }

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.

leramulina’s picture

Is there any patch for Drupal 6 version?

bennos’s picture

Status: Needs review » Needs work

Patch in http://drupal.org/node/966478#comment-5306058 does not work with the RC3 or the latest dev.

changing the status to needs work

damiankloip’s picture

@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.

rbrownell’s picture

Issue summary: View changes

Has there been any movement on this? I really need this functionality.

vasrush’s picture

If 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

jenlampton’s picture

@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.

jenlampton’s picture

Status: Needs work » Needs review
StatusFileSize
new2.14 KB

The 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.

dobe’s picture

I 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.

bhosmer’s picture

Status: Needs review » Needs work

With #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.

dobe’s picture

You 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.

bhosmer’s picture

StatusFileSize
new39.15 KB

@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.

Views_field_view_ui_exposed

dobe’s picture

Ahh. 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.

misterpo’s picture

Hi,

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.

viveksr2’s picture

Is 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!! :)

Azor Ahai’s picture

I'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.

Azor Ahai’s picture

Is anybody keeping up with this module anymore?

ashumateDrupal’s picture

I 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.

rgnyldz’s picture

I 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.

lucasantunes’s picture

I 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

lind101’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev

This is still an issue on the 8.x.1 branch. Switching version, can be back ported later.

lind101’s picture

Version: 8.x-1.x-dev » 7.x-1.x-dev

There 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.

vladimiraus’s picture

Status: Needs work » Closed (outdated)

Thank you for your contribution.
Drupal 7 is no longer supported.
Closing this issue as outdated.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.