We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12584
    • 208 Posts
    I am having a problem with the output on the landing page it is just blank with a form showing, all did work I think it may have gone wrong when I updated modx from 1.0.3 to 1.0.4

    My php version is 5.2.14 I have done a few searches and seen there was an issue with ajaxsearch 1.9.0 but only with php4x

    My search form in the templates looks like this
    [!AjaxSearch? &ajaxsearch=`0` &landingPage=`8` &addJscript=`0` &extract=`0` showResults=`0`!]


    And the landing page code is this

    [!AjaxSearch? &AS_showForm=`0` &AjaxSearch=`0`!]


    Everything used to work and I have not touched anything other than updating to the latest modx version 1.0.4

    Can anyone give me some pointers

    Thanks

    Ian
      • 5811
      • 1,717 Posts
      AjaxSearch has been updated with MODx 1.0.4. Some parameters have been renamed. Read this post

      Try with:
      [!AjaxSearch? &showInputForm=`0` &AjaxSearch=`0`!]
        • 12584
        • 208 Posts
        Hi

        Well the input form at least does not show but thre is still no results at all just a blank page, maybe there is something missing on the template form code, I will have a deeper read of the forum post you supplied.

        Just another thought it is possible that anything in the server MOD_security could stop the info being sent in the url string if indeed that is how it works.

        Thanks
          • 5811
          • 1,717 Posts
          Just another thought it is possible that anything in the server MOD_security could stop the info being sent in the url string if indeed that is how it works.
          May be you could check if the http request is received or not. install this plugin for firefox. After a search you should receive a http header like this one:
          Referer: http://www.site.com/index.php?id=38&advsearch=oneword&search=the&sub=Go%21
            • 12584
            • 208 Posts
            Thanks for the tip on the firefox plug in.

            Well I installed it and under the Generator tab I see a post request like this

            POST /index.php?q=search-results.html advsearch=oneword&search=111111111111111&sub=Go%21
            


            It shows as far as i can tell that my search containing lots of 1’s was sent in the header so I guess the issue must be something to do with the ouputting of the data does that sound correct.

            Cheers
              • 12584
              • 208 Posts
              Still hot getting this so work, I have 2 sites that have the same problem since the upgrade,

              Can someone please confirm that this snippet call is correct
              [!AjaxSearch? &ajaxsearch=`0` &landingPage=`8` &addJscript=`0` &extract=`0` showResults=`0`!]


              and anything else that I can try to get things working I am not a programmer just like to tinker a bit wish I understood more.

              Many thanks
                • 5811
                • 1,717 Posts
                [!AjaxSearch? &ajaxSearch=`0` &landingPage=`8` &extract=`0` showResults=`0`!]
                is better

                By default &ajaxSearch=`1` (ajax mode selected. By writing &ajaxsearch=`0` instead of &ajaxSearch=`0`, you select the ajax mode.
                ---- &ajaxSearch [1 | 0]   (optional)
                        Use the ajaxSearch mode. Default is 1 (true)
                        The AjaxSearch mode use an Ajax call to get the results without full page reloading


                By writing &addJscript=`0` you don’t include automatically the js librairy (mootools by default)
                But if you would like the non ajax mode &ajaxSearch=`0` this parameter is useless.
                ---- &addJscript [1 | 0]     (optional)
                        Set this to 0 if you would like to include the mootool/jquery librairy in the header of your pages manually.
                        By default set to 1. The library is added automatically


                  • 12584
                  • 208 Posts
                  Thanks for the info,

                  Well as far as I can tell everything is set fine on the AjaxSearch side of things the http headers pluh-ins does show the search term sent in the POST so I can only guess its some security thing set up on the server, maybe thre is a differance somewhere between the previous version and this one that the server does not like, I did try and change the POST request to GET in the template that done nohting except re-load whatever page I was on.

                  Will have a word with the server guy when hes back form holiday and see if its a mod security issue.

                  Thanks again.
                    • 18893
                    • 45 Posts
                    You have solved this problem?
                      • 12584
                      • 208 Posts
                      Well I got it working it was not exactly perfect to here’s my problem.

                      The 1st issue was that mod security on the server was deleting a couple of javascript files but I dont think that was causing the blank pages. Anyway the server bloke sorted out this issue so the server was now not causing a problem.

                      I then uploaded the version 1.8.5 as I knew this worked however I still got a blank landing page never did work out why.

                      I the fiddled with the snippet calls and ended up with this:

                      the call for the form field
                      [!AjaxSearch? &ajaxSearch=`0`!]


                      The results appear on the same page now with ajax using this call
                      [!AjaxSearch? &ajaxSearch=`0`!]


                      And thats it.

                      My plan was to have the results appear on a separate landing page but I could not get that to work however as it turns out this effect works quite well and the fact that it’s the only way I can get it to work will do for me.

                      I will PM you the site url so you can see the effect dont want to post it on here as it seems to invite more spam attacks.

                      Cheers