Skip Navigation

[Resolved] How to generate search results in a new page?

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.

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/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Waqar 3 years, 9 months ago.

Assisted by: Waqar.

Author
Posts
#1943127
Screenshot 2021-02-11 at 8.52.52 PM.png

Tell us what you are trying to do?
Hello - I'd like to be able to generate a NEW PAGE with the search results from a view.

Is there any documentation that you are following?
I watched this tutorial, but it didn't quite capture what I'm trying to do.
https://toolset.com/course-lesson/creating-a-custom-search/

Is there a similar example that we can see?
I would like the view that I have created in the sidebar of this page to generate a new page with the search results:
hidden link

What is the link to your site?
See above.

#1943297

Hi,

Thank you for contacting us and I'd be happy to assist.

For this example, suppose that your view's slug is "view-slug". To show the view's search results on a different page, you can follow these steps:

1. Please create a new page and name it something like "Library Search Results".

On this new page, if you only want to show the search results, you can use the shortcode:


[wpv-view name="view-slug" view_display="layout"]

If you'd like to show the search form and the results, then the shortcode would be:


[wpv-view name="view-slug"]

2. On your existing library page, where the search form needs to be, you'll update the view's shortcode in the sidebar to:


[wpv-form-view name="view-slug" target_id="1234"]

Please replace "1234" with the actual ID of the newly created "Library Search Results" page.

As a result, when the search will be performed on the library page, the visitor will be taken to the "Library Search Results" page for the results.

regards,
Waqar

#1943907
Screenshot 2021-02-12 at 10.43.37 AM.png

Thanks.. I'm a little confused about where to insert the line of code from step two. Here is what my search and pagination section of the view looks like. If I replace the submit button with the code you provided, the submit button just disappears.

#1948751

Thanks for writing back.

The shortcode from step 2 doesn't need to be added inside the view.

It will need to be placed in the Elementor builder content that is showing the sidebar, where you need the view's search form only.
( screenshot: hidden link )