Skip Navigation

[Resolved] Filter not working properly

This support ticket is created 7 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 6 replies, has 2 voices.

Last updated by randallH-3 6 years, 11 months ago.

Assisted by: Nigel.

Author
Posts
#592739

I have 2 views in a page where it both have filters.

When I click on the other section filter (text not checkbox) it selects the other view's filter.

Please see this link: hidden link

#592885

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screen Shot 2017-11-24 at 12.45.44.png

Hi Randy

You have added two Views to the same page—which is okay—that have the same filters for a custom taxonomy—not okay.

The problem is that the filters work by adding a URL parameter, and when the page is updated both Views see the same URL parameter and update accordingly.

The solution is straightforward, though.

Both Views currently have the default URL parameter added by the View when you inserted the filter. But you can change the name of the parameter on one of your Views so that they do not clash.

You need to change the name of the parameter in both the Filter Editor and the Query Filter sections. See my screenshot—where I have removed all other parts of the editor—where you need to change "wpv-analysis-category-1" to some other name that will be different than the other View.

I have another question from you in my queue about what I think is the same issue. Can you close that and, if you have problems, follow-up here?

#593143

Hi Nigel,

I already did that.

One is wpv-analysis-category-1 and the other is wpv-analysis-category.

I think that they are not the same since this one have 2 different filters.

#593144

The view is properly working when you use the checkbox, the only problem is when you click the label of the checkbox.

#593154

Okay, so I created a workaround using css. Any other ways to fix that without removing the click function on label?

Also, please confirm if I can ask here what I added on my other support ticket so I can close that?

#593365

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screen Shot 2017-11-27 at 10.51.27.png

Hi Randy

The markup for the checkbox and its label are generated by Views and it's not possible to change this without touching the plugin code.

An alternative workaround would be to use a little JavaScript to modify the form.

Take a look at the screenshot for a local test site of mine using an "exclude-hotel" checkbox field.

Note the for attribute of the label points to the id of the input ("wpv_control_checkbox_wpcf-exclude-hotel" in my example). The problem is that both Views have an input with the same id. You need to change the id of the input on the second View and change the for attribute of its label to something unique, and then the filters of the two forms will work independently.

Are you able to do that?

Why not close the other ticket and continue here with the related issue (I'm not sure what the problem in the other ticket is).

#595853

Closed.