Tell us what you are trying to do? Custom Search across two post types, but enable user filtering at outset to select one or other, results only show one or other according to user filter.
Is there any documentation that you are following? custom searches
Is there a similar example that we can see? I've tried setting it up here: hidden link
Thank you for contacting Toolset support. I would like to get clear idea on your requirements, there are some confusions:
1. Post type filter in View, have you added it using custom code? Because we don’t have this filter.
2. Do you want to add a dropdown or a field in the Custom Search View >> to list all posts Authors (users) >> so that people can search by post Authors?
3. OR do you want to make “Vets Or Practices” field required and people must select it first to serach?
4. Practice, Vet = these are Categories or Custom Post Types?
Please provide these details, screenshots will also help to clarify the requirements. Thank you
Hi Norman,
1. No, I've simply used a query filter for taxonomy and displayed it as a dropdown. But I don't think it's working anyway. See attached.
2. No, I don't want to search by users.
3. Yes, I want to force web site visitors to make a choice on what they search for first; vets for practices. Then they just get a free text field to search all toolset fields. I'm using Relvenissi so Toolset can search all fields.
4. Practice, Vet are both Custom Posts and Categories. I add the Category so I could create the taxonomy query filter, but originally I was trying to avoid having a taxonomy for these to custom post types.
What I"m trying to do is avoid having seperate search pages for these two custom post types.
If it were possible, I'd have a tabbed view cell at the top of the page. One tab labelled Vets and the other Practices. Toggling the tabs would reveal a different set of query filters appropriate to each data set.
But as I don't think that's possible, I was trying to find a way to force people to make a choice from a radio button or dropdown - then use a free text field search all toolsets custom fields.
I was also hoping this would filter the results below according to their choice so it only listed results for vets OR practices.
Can you advise if what I'm attempting is possible or if there's a better way to do it?
Thanks in advance.
Cam
“ What I"m trying to do is avoid having separate search pages for these two custom post types.
If it were possible, I'd have a tabbed view cell at the top of the page. One tab labelled Vets and the other Practices. Toggling the tabs would reveal a different set of query filters appropriate to each data set. “
This one is possible, steps would be as follows:
1. Create 2 Custom Search Views -- one for each Post type.
2. Using Layouts plugin >> add a Tab cell into it >> and in each Tab insert the View. One for Vets and second for Practices in separate tabs.
3. Please make sure to also enable “Ajax results update…” option for both Views, screenshot attached.
4. The Result will be something like in the attached screenshot.
OR if you are not using Layouts, you can also insert Bootstrap tabs directly into the page like this: