From the Modx Documentation:
Display a search form, and below it, the results:
1. [[!SimpleSearchForm]]
2.
3. <h2>Results</h2>
4. [[!SimpleSearch]]
I did the above and it worked great.
Instead of displaying the search result below the search box, I want the results to appear on another page.
What is the procedure to accomplish this?
Thank you.
This is what I had previously added "&landing=`123`" (except, I used my resource page), but it doesn’t seem to be working. No matter what other (resource) page I am on, the search result returns me to the (site_start) resource page 1. I am not using Friend URLs. I am using Modx Revolution 2.0.0-rc-2.
It definitely works for me. Can you post me your Snippet calls for each Resource?
shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect |
github |
splittingred.com
This is in my template:
[[!SimpleSearchForm? &landing=`35`]]
This is in resource 35:
[[!SimpleSearch]]
Very strange; that’s my exact config on splittingred.com, which works without a hitch.
- Does clearing your cache do anything?
- Also, can you tell me the output of the ’action’ attribute on search form’s form tag? IOW, can you tell me if the URL the form is submitting to is correct?
- You don’t have resource 35 protected or anything? Or in a separate context?
shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect |
github |
splittingred.com
I did some more testing, to no avail.
I did find a problem with the database. I just upgraded Modx Revolution 2.0.0-rc-1 to 2.0.0-rc-2, yesterday. I noticed that the database was set to a collation of "latin1-swedish-ci" instead of "utf8-general-ci." I have since changed all the tables back to "utf8-general-ci." The Modx "System Settings" are still set to "utf8." Everything else seems to be working fine.
I have created an error, unavailable, and unauthorized page in the resources and linked to their resource id in the "System Settings." I wanted to see if this would cause the jumping of the search results to the homepage, resource(1), to stop. Before, resource(1) was occupying some of these place values in the "System Settings." The search results still default to resource(1).
I have completely uninstalled "simplesearch", cleared the Modx cache, and closed it. I then cleared the browser cache and closed it. I restarted the browser and Modx. I installed "simplesearch" and its behavior has not changed.
As I said before, the "SimpleSearchForm" and "SimpleSearch" work if they are both located on resource(1), the homepage. If I try to move the "SimpleSearch" call to a different page and use the "&landing=`#`" parameter in the "SimpleSearchForm" on resource(1), after pressing return on the home page, resource(1), it only flashes like it has just been refreshed. I have also figured out, if I put both calls on any other resource page I am returned to the home page, resource(1), after pressing return on the form. It seems that it will only display the returned search results on the home page, resource(1), no matter what I do.
I have another Modx Revolution setup that I will try loading the "simplesearch" on.
Does this sound like a database issue?
I think I may have isolated the problem.
I have locally re-built my website and database using Xampp, MySql, and Modx Revolution 2.0.0-rc-2. I have installed all the add-ons that I have online. All is working fine, except the "simplesearch." The same problems exist on the local build that I previously mentioned is on the server build.
The only constant that I have found is that the [[!simplesearch]] call keeps pointing to the Modx "System Settings", "Site Start" value. Where ever this value is pointing that is where the search results want to display (it doesn’t show the results, just changes to that page), regardless of the "&landing=`#`" value. If I change the "Site Start" value to a different resource and then perform a search in the form, no matter which resource page the form is on, it returns me to the page that the "Site Start" value is pointing to.
Thanks for all of your help.
Do I have something set wrong in my Modx - System Settings?