Skip Navigation

[Resolved] Search results for different post types in tabs

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

Problem: I would like to create a View with one set of filters and show the results in tabs on the same page. A new tab should be created for each post type.

Solution: Create one View containing all the necessary filters, and build the loop to display the results for one post type. Use the Custom Search settings when inserting the View to display only the filters.

Insert the same View again, this time displaying only the results. Duplicate this View as many times as needed to display each post type. Insert only the results when you insert these Views, and be sure the URL parameters are identical when needed.

Relevant Documentation:
https://toolset.com/documentation/user-guides/digging-into-view-outputs/

This support ticket is created 5 years, 8 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 6.34 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by riinA 5 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#1217047

I have added search box for main menu, and would like to display search results in tabs.
So each tab will show assigned post type - is it possible.
Does toolset have also predictive search box similar service? So that search box in menu allready will predict what I like to search

Thank you in advance!

#1218256

I have added search box for main menu, and would like to display search results in tabs.
So each tab will show assigned post type - is it possible.

You could place separate Views in each tab, display only the results, and choose different content selections for each View. Then add one View showing only the filters. As long as the Views have the same Query Filter settings, the search results will be filtered correctly. There are some limitations to this approach.
1. No AJAX updates in these Views
2. No pagination in these Views

Does toolset have also predictive search box similar service? So that search box in menu allready will predict what I like to search
Like an autosuggest? No that type of filter is not offered. Toolset offers the following filter types:
- Radio
- Checkboxes
- Select
- Text input field

#1226210

Hi!

I have some questions for that

- You could place separate Views in each tab, display only the results, and choose different content selections for each View.
--- Can I use allready created views or I should create totally new view for search page. I need that in different tabs the result output is different style - so just chooshing different content selection is not helping

-Then add one View showing only the filters.
--- where do I add that? On top of the page, bottom? Is there some tutorial where I coud find more info about that? This part unfortunately I do not understand.

-As long as the Views have the same Query Filter settings,
--- Same - is there some tutorial you could point me so that I could look up for that.

Thank you in advance!

#1226820
param.png
search.png

Can I use allready created views or I should create totally new view for search page. I need that in different tabs the result output is different style - so just chooshing different content selection is not helping
Yes, you can use Views that have already been created as long as the URL parameters are consistent for all Views.

--- where do I add that? On top of the page, bottom? Is there some tutorial where I coud find more info about that? This part unfortunately I do not understand.
You can add the filters to the top or bottom of the page, it doesn't matter from a technical perspective. To insert a View showing only the filters:
- In your Content Template or Template Layout, click the "Fields and Views" button, then find the View containing all your filters.
- Click that View's button and you'll see another popup. If your View is configured correctly, you will see some different options for Custom Search configuration. You can choose to display the search form only (see attachment search.png). If you do not see Custom Search configurations in the popup, you may need to add a filter or a submit button in the View's Search and Filters panel.
- Choose "Only the search form" in the Custom Search Settings tab, then choose 'In other place on this same page"

-As long as the Views have the same Query Filter settings,
--- Same - is there some tutorial you could point me so that I could look up for that.

No tutorial that I'm aware of, but I can try to explain with an example. Let's say your custom search filters will contain a custom select field filter. When you create the filter in the Search and Pagination panel of your first View, you must specify a URL parameter name for this field. It will automatically be set to something like "wpv-wpcf-slug-1" (see attachment param.png). The Query Filter for this View will automatically be set to respond to the same URL parameter.

Now let's say you create another View for tab #2. You want to allow your visitors to search using the same select field filter, but you will not display the filters for View #2. You will only display the results for View #2, using the filter controls from View #1. It is important that all the Views use the same URL parameter name when they include the same custom field filter.

#1233774

My issue is resolved now. Thank you!