Home › Toolset Professional Support › [Resolved] Displaying search result on different page – I can't make it work
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 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | - |
- | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | 14:00 – 18:00 | 13:00 – 18:00 | - |
Supporter timezone: America/Jamaica (GMT-05:00)
Tagged: Custom search, Toolset Blocks, Views plugin
Related documentation:
This topic contains 15 replies, has 4 voices.
Last updated by hacerY 3 years, 7 months ago.
Assisted by: Shane.
Tell us what you are trying to do?
I have a View on the home page that has a search bar + a results section. I want to have the results display on a different page, not on the home page together with the search bar. But I can't seem to get it working.
In the documentation on this topic I see an image of the Custom Search Settings that need to be set right for this to work, but in my right menu I don't see this option in this same way.
I've made a short screencast to show you my issue.
You can watch it here: hidden link?
Is there any documentation that you are following?
https://toolset.com/course-lesson/displaying-search-results-on-a-different-page/
Is there a similar example that we can see?
n\a
What is the link to your site?
Directory index page: hidden link
Directory search result page: hidden link
Hi, I'm checking out both pages now and it seems that the search results page and the home page contain two different Views, because in the page source code I can see two different View IDs. Is it possible that you have created two different Views and placed a different View in the search results page from the View shown on the home page? If that is the case, you should edit the search results page and place the same View there as shown on the home page. Then edit the home page and see if the split filter and results settings appear when you select the top-level View block.
If not, create a new View block somewhere else on the homepage and select the same View to see if the split settings appear for a new View block. If so, use this new View block and delete the existing View block.
If you're not able to get this working or it's not behaving as expected, I can log in and take a closer look if you provide credentials in the private reply fields here.
Very odd, I'm not exactly sure why the Search results page did not appear in the options for the results destination location, but I believe I have a solution in place now. Here is a summary of the steps I took:
- I modified the View's custom search settings to better support splitting the filters and results into separate pages. For best results, you must select the option that requires a full page refresh when the User clicks the submit button, rather than AJAX updates. A full page reload is required to display the results on a different page.
- I deleted the View block from the Search results page and inserted a new View block. When I selected the Practitioners View, I could see the split display options. For now, I have chosen to display both filters and results. Feel free to modify if you want.
- I deleted the View block from the homepage and inserted a new View block. When I selected the Practitioners View, I had the option to display the results and filters on separate pages as expected. I chose to display just the filters for now. Feel free to modify that if necessary to show both.
- Since the "Search results" page never appeared as an option for the results destination, but other Pages could be found by typing "Directory" in the input field (attachment 1 directory-title-search.png), I suspected a caching issue. Purging the Litespeed cache did not solve the problem, unfortunately. So I temporarily renamed the Search results page and gave it a new title "Test search results" (attachment 2 test-title.png).
- I reloaded the homepage in the backend editor and was able to select the new Test search results page as the results destination (attachment 3 test-title-search.png). I am not quite sure why the Search results title is causing a problem here, but if necessary I can do some more in-depth investigation. My guess is something is stuck in the Views/Blocks caching system. The temporary title change workaround seems effective enough.
- I edited the Test search esults page and reverted to the original title "Search results". Now it seems that the search filters on the homepage are redirecting to the search results page as expected. Can you confirm?
Hi Christian!
Thanks for checking, and the detailed response. It is all clear now, and it is working well! I don't think you need to do any more in-depth investigation. Thank you.
One more question though: when I go to the 'Search results' page it asks me to 'Edit Original View' or 'Edit Copy'. If I indeed want to edit the view, which one should I select? Everything needs to be keep working as it currently is.
Please find screenshot attached of what I see.
Regards,
Hacer
Hi Christian,
I went already forward and clicked on Edit Original View. I saw that the result page showed me 3 column in grid-view, while I had saved it as 4 columns before. So I changed this back to 4 columns. And I have unticked Search from the View settings for the result page, because I only want the results here.
And I have also changed a bit the style of the Search bar on the Directory Index page.
But now when I do a search I see the following: the results show up in the Search result page, however, after showing the results, the Search bar shows up on the bottom of the page.
How is this possible? I don't want any search bar on the Search result page, and unticked this in the View settings.
Please find screenshot attached.
Regards,
Hacer
Hmm, not sure why the filters would be showing up now on the results page after you disable them in the configurations. That is odd. My first suggestion is to delete and recreate the View block on the search results page, and see if this solves the problem. If not, I can take another look.
Hi Christian, thanks for the suggestion. I did exactly what you proposed. I deleted the View in the Search result page, and recreated it again. Then I saw that the search bar on the bottom was indeed gone, but the Grid view reverted back to 3 columns. I want 4, so I changed that to 4 columns. After saving, I saw that the Search bar was back again on the bottom.... It seems like this happens each time I update the search result page after I recreate the View.
Not sure why this happens. Can you please have a look? Thank you so much!
Okay that's strange, I don't see anything obviously wrong here. I have hidden the filters on the search results page for now using a CSS solution, but that shouldn't be necessary. I'd like to make a clone of the site to see if I can replicate the problem in a copy of your site installed on my local environment. Is it okay for me to use the All-in-One Migration plugin to make a site copy and run some more tests?
Thank you for the temporary CSS solution Christian. Yes, I'd appreciate it if you could try to replicate the problem on your local environment. There is already the All-in-one-WP-Migration plugin on the site because I use it also for backups. Please go ahead! Thank you.
Quick update to let you know I was able to create the site clone and install it on my local environment. I'll continue my investigation and keep you updated here. Thanks for your patience!
Hello again - I was not able to come up with a good solution yet, so I have escalated this to my 2nd tier support team for additional investigation. I believe something specific to these two Pages and these two View blocks is cached and stuck in a way that I cannot resolve directly from wp-admin. If I create two new Pages and insert the same Practitioners View, split and displaying filters and results on separate pages, the problem does not occur! No CSS workaround is required there. Same View, same configurations in the View blocks, different results. It is not very obvious how to solve this, so I'll have 2nd tier support take a closer look. I will keep you updated here as I get more info from Nigel.
hi Christian,
Thank you for escalating this. Yes, it is quite weird, and seems as if nothing works properly anymore. When I try to update the View search bar, it also doesn't recognize anymore that I already have one in place and asks me to create a new Search. I don't want to create everything from the beginning, because I'm not sure if that won't end in having the same issue. So I've copied an earlier backup where my Search view was still working to a local environment, and made my changes in there, and then imported the Search view back into the subdomain via Toolset Modules. It is not a solution, but it got me to the point where I am actually good enough to push my directory from this development subdomain to the main domain, so it can go live. I will do that today or Monday.
If the 2nd tier support team can figure out the problem, I would still be interested to know about it. At the end I it is easier to work on a View that functions as it should. So, it would be great if you could keep me informed about their findings. I'll leave the subdomain active until we can hopefully solve this mystery ! 🙂
Thank you so much.
Hi Hacer,
As Christian is currently on vacation I will be responding here on his behalf. I've checked on the escalated thread with Nigel and this was the result below.
Nigel had instructed that you go through the procedure of setting up the view for the results only by doing the following
1. Create a page for the search <b>results</b> first, then add a View block and creating a new search View as required.
2. Make a page for the search form, add a View block, and use the existing View just created. You can then specify that it should show only the search form, with the results on a different page; specify the page from the first step.
3If you test on the front end this meets the basic requirements, but still shows the search form on the results page.
4.So go back and edit the search results page, and with the View block selected, in the settings toggle off the option to show Search.
Finally use the css below to hide the search area on the results page
.wp-block-toolset-views-custom-search-container { display:none; }
Our development team is now aware of the issue but please let me know if this helps.
Thanks,
Shane
Hi Shane,
thanks for checking with the 2nd tier support team. The steps you have described were already shared with me by Christian. So that is what I've already done. Are you saying that there is no real solution for the issue at this point and that I have to work with this workaround?
It isn't clear to me if the dev team is still planning on doing something about this, or that this recommendation would be it for now, and we close the ticket?
The workaround is OK for now, I just wanted to confirm.
Regards,
Hacer
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hi there
As Christian is still off, let me jump in here.
The developer replied in the internal ticket and said for this to work, we're doing it wrong, and gave these directions:
If the user wants to have the form and the results in entirely separate pages, they need a third page where they desgn the full View (it can even be a draft, no need to publish it), both form and results, and then they should insert results on a page, and the form on another page pointing to the page holding only the results.
In a future update we plan to decouple editing Views from a page so that you can create the View independently and then insert the form on one page and the results on another page, so the workflow will make more sense.
Currently it is expected when splitting the results from the search form that the search form would still be shown on the results page because users may want to refine their search criteria, and in your use case that would mean them returning to the page containing the search form.