Skip Navigation

[Resolved] Using buttons to update the view on the page

This support ticket is created 6 years, 2 months 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by markM-8 6 years, 2 months ago.

Assisted by: Waqar.

Author
Posts
#1154822

I would like the option to have 3 buttons on a page and when a user clicks one of these buttons, the View below updates, preferably in an ajax manner. I have looked through the support form but nothing is doing what I need

Here is the old design layout hidden link
Ideally the taxonomies in the drop-down we would like to each be a button

#1155262

Hi Mark,

Thank you for contacting us and I'll be happy to assist.

Making custom buttons work with AJAX based results will involve a fair deal of script customizations, which are beyond the scope of support that we can provide.

But, without AJAX, the steps are relatively simpler:

1. First, please create your view with a front-end filter for the taxonomy that you'd like to filter the results by:
( example screenshot: hidden link )

Note: Here is a guide on the topic of adding front-end filters:
https://toolset.com/documentation/user-guides/front-page-filters/

2. Remove the HTML code for the front-end filtering field from the view's "Search and Pagination" section, but keep the relevant query filter settings.
( screenshot: hidden link )

3. Next, you can add HTML code for the three forms with a hidden field. Each form will act as a button for each of the taxonomy term:


<form action="" method="get">
	<input type="hidden" name="wpv-employee-category" value="emp-cat-1">
	<input type="submit" value="Button 1">
</form>

<form action="" method="get">
	<input type="hidden" name="wpv-employee-category" value="emp-cat-2">
	<input type="submit" value="Button 2">
</form>

<form action="" method="get">
	<input type="hidden" name="wpv-employee-category" value="emp-cat-3">
	<input type="submit" value="Button 3">
</form>

Notes:

1. The above HTML code can be included anywhere on the same page as the view, either through the page's content where the view is present or in the view's "Loop Editor" section.

2. Please replace the URL parameter "wpv-employee-category" in the form, with the actual filter parameter set in your view's "Query Filter" section.
( example screenshot: hidden link )

3. Also, replace the values "emp-cat-1", "emp-cat-2" & "emp-cat-3", with the actual slugs of your taxonomy terms.

I hope this helps and let me know if you have any question around this setup.

regards,
Waqar

#1156396

Thank you Waqar. I will look at this early next week and confirm if it works. Appreciate your help.

#1157533

You're very welcome, Mark!

#1161667

My issue is resolved now for now. Thank you!