We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20448
    • 48 Posts
    Hi All

    Please can you help? I have tried the Ajaxsearch wiki to get my results page displayed on a separate page. The results are being displayed on a seperate page but also results are being displayed below my search form and all the results are overiding the right hand side of my site.

    I want to launch my clients site over the weekend but cannot get the search to work. Can you please help.

    The site is www.cottagebreak.com

    Thanks

    Phil
      Get your business online - Adapt Web Design www.Adaptwebdesign.com
      • 5811
      • 1,717 Posts
      On your site you use the default ajax mode (&ajaxSearch=`1`), so the results are displayed thru an ajax window on the same page. If you want display the search results on an another page, use the non-ajax mode : &ajaxSearch=`0` and defined the landing page where you want display your results.
      Go on these demos pages and follow the examples.
        • 20448
        • 48 Posts
        Hey folks, I have tried this but I am now getting errors, and the contents is still showing on the right also. What else can I do?

        I get the below after making the recommended changes

        [+as.showResults:is=`1`:then=` [+as.noResults:is=`1`:then=`
        `:else=`

        Then the results are displayed. What am I doing worng?
          Get your business online - Adapt Web Design www.Adaptwebdesign.com
          • 5811
          • 1,717 Posts
          I get the below after making the recommended changes

          [+as.showResults:is=`1`:then=` [+as.noResults:is=`1`:then=`
          `:else=`
          I think that you encounter this issue due to the number of results. Look at this post http://modxcms.com/forums/index.php/topic,42498.msg254593.html#msg254593 to know how to fix it.


          and the contents is still showing on the right also
          Your upper right ajaxSearch snippet call should contain &AS_showResults=`0` to not display the results.
            • 20448
            • 48 Posts
            Hi Guys

            I do not think this is the answer. I have not got PHx installed. The instructions are not very clear. I am a modx newbie so this is all a bit new to me. Any more guidance help would be appreciated.

            Thanks

            Phil
              Get your business online - Adapt Web Design www.Adaptwebdesign.com
              • 5811
              • 1,717 Posts
              I do not think this is the answer. I have not got PHx installed
              This is the answer. But you are not obliged to follow my advices wink AjaxSearch uses internaly the same functions as Phx. Even without Phx installed, you use the same functions (Extended placeholders & parser).

              The instructions are not very clear. I am a modx newbie so this is all a bit new to me.
              I understand. This subject is tricky.

              A/ To avoid to display the results you shoud specify &ajaxSearch=`0` and specify a landing page with the &AS_landing parameter

              B/ Regarding the broken parsed placeholders, this issue comes from the limitation due to the pcre_backtrack limit PHP parameter. This limitation will be bypassed with the next release of ajaxSearch (1.8.5). This release will be provided with MODx 1.0.3. Waiting this new AjaxSearch release you could install the fix on your current 1.8.4 release. For this do as below:

              open the file assets/snippets/ajaxSearch/snippet.ajaxSearch.txt

              1/ Replace the lines 68-69:
              //include snippet file
              define ('AS_PATH', $modx->config['base_path'].AS_SPATH);
              by the lines:
              // include snippet file
              define ('AS_PATH', $modx->config['base_path'].AS_SPATH);
              
              // pcre backtracktrack limit
              define ('PCRE_BACKTRACK_LIMIT', 1600000);
              This defines a value for a constant named PCRE_BACKTRACK_LIMIT.

              2/ then replace the lines 412-414:
                $as = new ajaxSearch(AS_VERSION,$cfg,$dcfg);
                //Process ajaxSearch
                $output = $as->run();
              by the following lines:
                  $as = new ajaxSearch(AS_VERSION,$cfg,$dcfg);
                  //Process ajaxSearch
                  $current_pcre_backtrack = ini_get('pcre.backtrack_limit');
                  ini_set( 'pcre.backtrack_limit', PCRE_BACKTRACK_LIMIT);
                  $output = $as->run();
                  ini_set( 'pcre.backtrack_limit', $current_pcre_backtrack);
              With these new code lines, you save the current value of the PHP pcre.backtrack_limit parameter. Then you increase the current value of this parameter, execute the search and then restore the pcre.backtrack_limit parameter.

              Any more guidance help would be appreciated.
              Hope this help suit your request.
                • 20448
                • 48 Posts
                Hey coroico

                Many Thanks for the additional information. I have applied the changes you have sugeested but still have the same results?

                What else could this be?

                Thanks
                  Get your business online - Adapt Web Design www.Adaptwebdesign.com
                  • 5811
                  • 1,717 Posts
                  Have you cleared the MODx cache (site tab in the manager) before to redo a test ?

                  If yes, increase the value of the backtrack_limit by 10
                  define ('PCRE_BACKTRACK_LIMIT', 16000000);
                    • 20448
                    • 48 Posts
                    Hi

                    I have made the changes and cleared the cache and still no joy. See http://www.kettlebelltrainer.co.uk/modx/.

                    I have even increase the number of 16000000
                      Get your business online - Adapt Web Design www.Adaptwebdesign.com
                      • 5811
                      • 1,717 Posts
                      When I search "stren" I get 22 results displayed on the landing page. Seems to be correct. Where is the problem ?

                      [EDIT] Ok, you got the problem with "ket". This is due to the number of results and the pcre-backtrack limit.