I'm using two views with the same filters, with exposed filters in a block.

Exposed works, but when I change the tab, the exposed is not apllied.

Could it be done?

At 2001.03.07 I'm Using Drupal 6.1.6, last Views 2.dev, and last Beta-6 of Views Display Tabs.

Comments

Sinan Erdem’s picture

Subscribing.

ruphus’s picture

Subscribing

Nipsting’s picture

Looking for a solution to the exact same problem myself.

Have 3 pages in a views setup and all of them have the same exposed filters applied, and the filters reset when I click another tab.

solipsist’s picture

Did you set the exposed filters for the default display and have the displays shown as tabs inherit the filter? If you set up the filters manually for each display they will all have different IDs.

Sinan Erdem’s picture

If you mean "Filter identifier" by "ID", then I have checked each exposed filter for each display and they have the same Filter identifier.

I also tried the patch on issue #619400: Exposed filter block but it doesn't seem to work...

Any ideas?

Sinan Erdem’s picture

I think the problem is:

When I click a tab, it links to a url like: www.example.com/?vdt=my_views_name|block

But exposed filters need to have a url like: www.example.com/?tid=1

I confirm that a url of the combination of two of them, like: www.example.com/?tid=1&?vdt=my_views_name|block
works perfect.

Is it possible to do this?

ruphus’s picture

Changing line 103 in viewsdisplaytabs.module from
$displays[$group][] = theme('viewsdisplaytabs_tab', $title,$_GET['q'], $view->name, $display_name, $active);
to
$displays[$group][] = theme('viewsdisplaytabs_tab', $title,"http://".$_SERVER["SERVER_NAME"].preg_replace("!(.*)(&vdt.*)!","$1",urldecode($_SERVER["REQUEST_URI"])), $view->name, $display_name, $active);
Seems to do the trick, albeit creating a javascript error.

It's a quick and dirty fix not properly tested and probably will not work with ajax enabled.

-William

dobe’s picture

subscribing

dobe’s picture

StatusFileSize
new2.26 KB

I worked on this a little and came up with a small solution I think. It does need some work thats for sure. I am pretty sure I did not create this patch correctly working on figuring out how to do these things properly.

dobe’s picture

StatusFileSize
new2.3 KB

LOL that didn't work try this one.

foredoc’s picture

Any updates on this? Thanks.

hanamizuki’s picture

subscribe

bomari’s picture

any one try to disable the AJAX for one of the tabs , try it
if you have two tabs just edit the view and disable ajax from the Basic settings for one of the tabs

devkinetic’s picture

looking for an update as well...

devkinetic’s picture

I encountered this bug yesterday and wanted to follow up with my workaround (not a fix, just worked for me). What I did is modify the setup my second view and added what was my exposed filter as an argument.

This is ugly, but in the module's javascript around line 94 I retrieved the value of the exposed filter field if it existed, and set it to the hidden input for arguments to be passed when the form is executed.

I had to wrap the javascript below in the php designation to get everything to display right, but be assured this is javascript, not php.

var cal_date = $(form).find('input[name="date_filter[value][date]"]').val();
if (cal_date) { Drupal.settings.views.ajaxViews[i].view_args = cal_date; }
$(form).find('input[name="view_args"]').remove();
$(form).append('<input type="hidden" name="view_args" value="'+ settings.view_args +'"/>');

I should note that if you do anything like this you move your module from modules/contrib to modules/custom because if you update the module it will remove your code.

ChrisValentine’s picture

I notice that when you click the tabs it generates a JavaScript error:

Error: TypeError: this.submitForm is not a function
Source File: http://mydomain/sites/all/modules/viewsdisplaytabs/viewsdisplaytabs.js?u
Line: 110

...which suggests that its trying but failing to re-send the exposed filters search form. My filters are in a block - not sure if that's relevant.

Drupal - 6.24
Views - 6.x-2.16
Views Display Tabs - 6.x-1.0-beta6
Views Tabs - 6.x-1.x-dev
Better Exposed Filters - 6.x-2.0-beta1

acrollet’s picture

Version: 6.x-1.0-beta6 » 6.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new2.23 KB

patch attached for 7.x, based off of #10

acrollet’s picture

slightly updated patch attached.

solipsist’s picture

Thanks for the patch!

mediaformat’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community