Skip Navigation

[Resolved] Search results page with a view for each post type (multiple views)

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

Problem:

- I need to create a search results page that contains multiple views (for different post types)

- A globally used search field (for the site header) that displays its results on the search results page.

Solution:

It is possible to pass same URL parameter to multiple views, and take effect on all of them, but you need disable AJAX search feature, for example:

https://toolset.com/forums/topic/search-results-page-with-a-view-for-each-post-type-multiple-views/#post-1735377

Relevant Documentation:

This support ticket is created 4 years, 5 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/Hong_Kong (GMT+08:00)

This topic contains 6 replies, has 2 voices.

Last updated by marsattack8 4 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#1735203

Tell us what you are trying to do?

- I need to create a search results page that contains multiple views (for different post types)
- A globally used search field (for the site header) that displays its results on the search results page.

The results views will list out different fields like this:

(PT) PAGES
- Title
- Body

(PT) VIDEOS
- title
- category
- video
- description

(PT) Glossary
- Term name
- Description

I tried creating a view for each post type and then applying them to a search archive view, but I can't get it to work.

#1735377

Hello,

It is possible to pass same URL parameter to multiple views, and take effect on all of them, but you need disable AJAX search feature, for example:

Edit each post views:

1) in section "Custom Search Settings", enable option: Full page refresh when visitors click on the search button,
2) In section "Search and Pagination", add a submit button

#1735541

Thank you. Should I be putting those views into a search archive view? If so, how would I go about correctly doing that? Putting them in the loop doesn't seem to work.

#1735547

You can create a new page, and display all those view in the same page. Please let me know if you need assistance for it, private message box enabled.

#1736903

Thanks for the details, I can login your website, will update here if find anything

#1736909

Here are what I find:
1) The post view "search pages" might be broken, and I create another fresh new view "search pages 2" here:
hidden link
You can customize it manually.

2) For the issue: calculate the number of results combined, it needs another post view:
hidden link
Filter by:
- Filter post title, content and fields by a text search that will be added manually using the shortcode [wpv-filter-search-box].
- Exclude posts with the following IDs: 198,98,46

in section "Loop Editor" line 3, display the shortcode: [wpv-found-count]
hidden link
line 10, display 0 value when there is any item found

enable option "Disable the wrapping DIV around the View"

3) results for the term: search term
You can use [wpv-search-term] shortcode to output the URL parameter, for example:
[wpv-search-term param="wpv_post_search"]
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-search-term

#1738259

Thank you so much!! It's working beautifully. I appreciate you!