We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34162
    • 1 Posts
    This is an auto-generated topic for <a href="http://modxcms.com/extras/package/683">SimpleSearch 1.0-beta1</a> by splittingred.

    Brief Description:
    A simple search solution for MODx Revolution. Loosely based on AjaxSearch for Evolution (minus the ajax). Only searches Resources; does not search dynamic content.



    See the official documentation here:

    <a href="http://svn.modxcms.com/docs/display/ADDON/SimpleSearch/">http://svn.modxcms.com/docs/display/ADDON/SimpleSearch/</a>
      • 1329
      • 15 Posts
      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.
        • 28215
        • 4,149 Posts
        Similar to AjaxSearch, really. Just add the &landing=`resourceIdHere` parameter to the SimpleSearchForm snippet.

        So, if your results are on a Resource with ID 123:
        [[!SimpleSearchForm? &landing=`123`]]
        


        And that will make the search form submission "land" (or submit to) Resource with ID 123. Then just put your [[SimpleSearch]] call in that Resource.
          shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
          • 1329
          • 15 Posts
          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.
            • 28215
            • 4,149 Posts
            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
              • 1329
              • 15 Posts
              This is in my template:
              [[!SimpleSearchForm? &landing=`35`]]

              This is in resource 35:
              [[!SimpleSearch]]
                • 28215
                • 4,149 Posts
                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
                  • 1329
                  • 15 Posts
                  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?
                    • 1329
                    • 15 Posts
                    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?
                      • 22840
                      • 1,572 Posts
                      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.

                      I have the same problem, I upgraded to the latest revolution release this morning and added the simple search and it always goes to my site start page when I preform a search.

                      Just to add, the search query is being added to the url ( index.php?search=test ) however i cant actually get it to return any results at all, I have a page called about me and if I search for about me and add the following to my home page all I get is the no results found message.

                      <h2>Results</h2>  
                      [[!SimpleSearch]]