Tell us what you are trying to do?
I would like to know how you got the functionality on the Toolset Support page for the Search bar to give it the ability to "Search Support Forum, Errata and FAQ to get help instantly"?
Is there a similar example that we can see? Yes, on the Toolset Professional Support page where one enters a search term and the results end up like the screenshot attached.
This will be for a new site.
There are a few things going on here that make this page special, in my opinion:
1. Two different sets of results, one for post type A and another for post type B.
2. The results are empty until a search term is entered.
3. The results update without reloading the page.
You can use a combination of multiple Views to achieve something similar with a URL parameter in the search bar, but #3 would require custom code that is beyond the scope of the support we provide here in the forums. You must trigger a full page load to update the results correctly.
- Create a custom search View of post type A. Include a text search filter and submit button in the Filter Controls, and use the Loop Output area to build your design for displaying post type A. Remove "No items found" from the no items found loop text. Do not use AJAX to update the results.
- Create a custom search View of post type B. Include a text search filter and submit button in the Filter Controls, and use the Loop Output area to build your design for displaying post type B. Remove "No items found" from the no items found loop text. Do not use AJAX to update the results.
- Insert the View for post type A in a page, including both the search form and results. Then insert the View for post type B immediately after that View, but include only the results.
- Now both Views will respond to the same URL parameter text searches, and will update simultaneously to show relevant results.
- If you want to show no results until someone enters a search term, you can add a bit of custom code using wpv_filter_query:
add_filter( 'wpv_filter_query_post_process', 'drop_empty_textsearch_query', 10, 3 );
function drop_empty_textsearch_query( $query, $view_settings, $view_id ) {
if ( !isset($_GET['wpv_post_search']) ) {
$query->posts = array();
$query->found_posts = 0;
$query->post_count = 0;
}
return $query;
}
Let me know if you have questions about this process and I'll try to provide more details.