Skip Navigation

[Resolved] Add a search filter to the search form

This thread is resolved. Here is a description of the problem and solution.

Problem:

Add a search field in the custom search form.

Solution:

You can follow our document to setup the custom search form.

Relevant Documentation:

https://toolset.com/course-lesson/creating-a-custom-search/

This support ticket is created 3 years, 9 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.

Our next available supporter will start replying to tickets in about 1.73 hours from now. Thank you for your understanding.

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/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 7 replies, has 2 voices.

Last updated by maiS 3 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#1969971

hi again ,
Is it possible to add a search filter to the search form "Search for badminton camps" where you can choose whether you want camps with sleep over or not? So the search filter could have a title like "sleep over" and then a drop down with "yes" and "no" and then it works as a filter for the camps too?

#1969999

Hello,

Yes, it is possible, you can follow our document to setup the filter in search form:
https://toolset.com/course-lesson/creating-a-custom-search/

Please let me know if you need assistance to for it.

#1971423

Hi,
I already watched this guide and i can not figure out how the "Yes" / "No" option work so it filters the camps after whether there are sleep over or not.

#1971773

I have done below modifications in your website:
1) Edit two "camp" posts:
hidden link
hidden link

Setup the field value "Is the camp including a sleep over?"

2) Edit the page:
hidden link
In the search form, add a search field "Is the camp including a sleep over?"

You will need to edit all "camp" posts, setup the field value "Is the camp including a sleep over?"

#1975425

hi Lou,

Thank you so much! I want to edit the view because i want the field "is the camp including a sleepover" to have a little margin so it not too close to the edge of the screen. But when i press "edit view" the search field with sleepover is not showing up? Where is it? 🙂

#1975497
grid-margin.JPG

You are using the same view blocks in multiple pages, it conduct the problem you mentioned above.

I have done below modifications in your website:
Edit the problem page:
hidden link
1) find the view block and click "Edit Original" button, reset the search field "Is the camp including a sleep over?"
2) Find and select the grid block, add a margin-left value in it, see my screenshot grid-margin.JPG

For your reference.

#1977247

hi there,
Okay i went into the view and pressed "edit original" and added the search field again. Then i updated the page. Then all the results show up on the same page instead of the result page.

Then i remove the view and add it again and set it to show only search form and then results on another page. Everytime i edit a view i have to update the page, then remove the view, add it again and set it to only show search form on the specific page and search results on another page to make it work.

But i think it works now! Thanks.

#1977249

My issue is resolved now. Thank you!