We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24986
    • 8 Posts
    Hello everyone,

    I know that this is explained within the AjaxSearch chunk, but I’m still none-the-wiser about how to configure the search for this function. I am simply after the results opening in a new page and not underneath the search box after submission.

    If someone could take two moments to post a little step-by-step of how this is done, I would really appreciate it.

    For simplicity, I tried to search for this answer already, but to no avail.

    Thanks in advance and regards,

    Richard.
      • 34162
      • 1 Posts
      Call the AjaxSearch snippet in this way:
      [!AjaxSearch? &AS_showResults=`0` &ajaxSearch=`0` &AS_landing=`16`!]


      Where &AS_landing should refer to the ID of the page where you want to display the results on.

      That’s all there is to it!
        • 24986
        • 8 Posts
        Hello WeBe,

        Thanks for your help thus far. I’ve inputted the snippet you posted and my results indeed open in the desired page.

        However, my results don’t seem to be showing up. Do I need to put something in the page itself to ensure the results show?

        Richard.
          • 34162
          • 1 Posts
          Sorry, forgot to tell you that you should include this in your result page:
          [!AjaxSearch? &AS_showResults=`1` &AS_showForm=`0`!]


          That should do the trick.
            • 24986
            • 8 Posts
            Perfect!

            Thank you so much for your help, WeBe!

            Richard.
              • 23802
              • 65 Posts
              yo thanks, webe.

              I have another question, if landing page is ID i suppose it’s pages URL without mod-rewrite activated. How the heck can i check what page’s ID if want to refer search result to .

              thanks mate.
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Doesn’t apply in this case. The mod-rewrite thing is only used for generating links. For internal use, MODx uses document ID to know which document to redirect to.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 23802
                  • 65 Posts
                  is this ID a number inside of ( ) near each document?

                  Thanks mate.
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Yes.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 19889
                      • 616 Posts
                      Quote from: WeBe at Dec 30, 2006, 08:43 AM

                      Sorry, forgot to tell you that you should include this in your result page:
                      [!AjaxSearch? &AS_showResults=`1` &AS_showForm=`0`!]


                      That should do the trick.

                      I’m kind of struggling with this as well - is it possible to have the search form as well as the result on the same page - if yes, I’d appreciate if somebody could give me an example.

                      Moreover, I can’t get the ajax version of the script to work - if I enable immideate search while I’m typing, I get an AJAX error. Another issue is when I click on that ugly button that clears the result area, I get a javascript error.

                      Am I doing something wrong? Are there an good alternatives to ajaxSearch.

                      Thank you in advance for your input.