We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27889
    • 415 Posts
    Thanks a lot, its work like a charm,
    I copied/pasted the parameters from ajaxSearch_readme.txt to be sure they are right but this is not the case. grin

    If you have time to modify ajaxSearch_readme.txt the noob like me doesn’t ask such sort of question.
    Now I’m going to have a try with the Ajax search.
      MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
      MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
      • 27423
      • 10 Posts
      Thanks for this great snippet!  I seem to have a problem with the &ajaxSearchType paramater and the highlighting.

      I have this call on my search page;
       [!AjaxSearch? $ajaxSearch=`1` &ajaxSearchType=`1` &ajaxMax=`10` &extract=`1`!] 


      It shows the Go! button on the form, it does show the extract on the results page but the highlight does not follow onto the final page, the remove highlight and search terms do show on the final page.  I have follwed the instructions and added the plugin.  Using MODx ver 0.9.2.1 Any hints on what I am doing wrong?  Thanks

      note: is it posible that the url from the result is the culprit? /index.html&searched=mobile&highlight=ajaxSearch_highlight+ajaxSearch_highlight1
        • 27423
        • 10 Posts
        Geeze I figured it out.. forgot to add the highlight to the css file;

        .ajaxSearch_highlight1

        Now just to get the live search working.. the Go button does not change when I use the parameter &ajaxSearchType=`1` ??
        • Are you sure the .js files are getting loaded? I had a similar problem, and it turned out that they weren’t getting loaded. I forget now exactly why.
            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
            • 27423
            • 10 Posts
            I have them in my template and if I view source on the search page it shows in the <head> the calls;
            <script src="manager/media/script/scriptaculous/prototype.js" type="text/javascript"></script>
                    <script src="manager/media/script/scriptaculous/scriptaculous.js" type="text/javascript"></script>


            I checked the paths and the files are there.

            I also check using Firefox and IE, does the same in both.  Is there another way to check and see if the javascript is being loaded properly?

            i also tried to change the above code to include the [(site_url)] in the src url and that didnt seem to make any difference either.  What am I missing?.. rolleyes  Many thanks for your response, I’m just learning little by little..
            • What about AjaxSearch.js? The prototype and scriptaculous are probably there because QuickEdit loaded them.
                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
                • 27423
                • 10 Posts
                Added the AjaxSearch.js to the head and still same thing.. Maybe I need to sleep on this.. I think I have done everything possible.. the only thing I can think of is that one time while messing with the code for the contact snippit and I found a error message about a server protection something or other and maybe my host is blocking this.

                Thank you again for your help, I know you must have better things to do than help with little things like this.

                I will post back with any results I find..
                  • 27889
                  • 415 Posts
                  You can try to insert base_url in front of the path, perhaps, if your page is in a folder the relative path isn’t good.
                    MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
                    MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
                    • 27423
                    • 10 Posts
                    Thanks for the tip... When I use the version from here http://modxcms.com/forums/index.php/topic,3501.msg31968.html#msg31968 It works with no errors except for no &ajaxSearchType, but when I use the latest from the repository I get an livesearch is undefined error. Even with the calls to the js files in the header it must not be including them. Anyways thanks again, the default is good too smiley
                      • 27423
                      • 10 Posts
                      An update to my story  rolleyes

                      I get this warning:

                      Script or Action Blocked

                      The requested URL /index-ajax.php?q=assets/snippets/AjaxSearch/AjaxSearch.php&search=mobile&maxResults=6&stripHtml=1&stripSnip=1&stripSnippets=1&useAllWords=0&searchStyle=partial&minChars=4&showMoreResults=0&moreResultsPage=0&moreResultsText=Click%20here%20to%20view%20all%20results.&resultsIntroFailure=There%20were%20no%20search%20results.%20Please%20try%20using%20more%20general%20terms%20to%20get%20more%20results.&docgrp=&_= contains a script or action that has has been deteremined unsafe. It has been disabled to prevent abuse.


                      --------------------------------------------------------------------------------
                      This server protected by: SecurePHPx

                      So it looks like I cannot run that script with my hosting providor.. I thought I was doing it right!  Anyone else have this problem? I read somewhere that it could be the %20 part.. maybe replace that with somthing else will work..

                      This discussion is closed to further replies. Keep calm and carry on.