Skip Navigation

[Gelöst] Trigger search filters from an external source.

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:
Trigger search filters from an external source.

Solution:
To trigger the search filter obviously you will require to add the custom JavaScript code that should trigger the change event of the country dropdown.

You can find the proposed solution in this case with the following reply:
=> https://toolset.com/forums/topic/trigger-search-filters-from-an-external-source/#post-2037713

Relevant Documentation:

This support ticket is created vor 2 Jahre, 11 Monate. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 Antworten, has 3 Stimmen.

Last updated by Stephen Vaughan vor 2 Jahre, 11 Monate.

Assisted by: Minesh.

Author
Artikel
#2037533
Screenshot 2021-04-30 at 09.37.17.png
Screenshot 2021-04-30 at 09.37.02.png
Screenshot 2021-04-30 at 09.36.43.png

Tell us what you are trying to do?

I have a map set up using the Interactive Geo Maps plugin. With this you can hover over each region on the map and it will trigger an action. As you can see in my screenshots I have the Action Content field set up to go a specific page, but, what if I could set a trigger to change the County filter in a view to narrow down the listings to just that county. Is there any toolset method to do this, before I go off to what I presume will be a javascript solution?

#2037701

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

To trigger the search filter obviously you will require to add the custom JavaScript code that should trigger the change event of the country dropdown.

Do you mean you want to prefilter the view result with specific country? If yes, again on document ready event you should add add a JS code to change the option of country dropdown.

#2037713

Nigel
Supporter

Languages: Englisch (English ) Spanisch (Español )

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

Hi Stephen

You will need a JS solution, yes.

You'll react to the event triggered by clicking on the map, and then update the option for the county filter with JS.

If you are using the setting that the View results should update whenever a filter value changes then you need to be aware that this responds to the change event on the filter, but when you programmatically update the selected option the change event is not triggered, and you'll need to do that yourself.

Something like

jQuery("select[name='wpv-county']").val("clare").change();
#2037715

Thanks again Nigel. That gives me something to work with.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.