We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8416
    • 173 Posts
    Hello,
    Is there a way to get the AjaxSearch to work using the parents parameter to narrow a search scope without setting addJscript.
    The call below doesn’t take into account the parents setting. The search result will be global.

    [!AjaxSearch? &parents=`47`  &depth=`3`  &language=`english` &ajaxSearch=`1` &AS_landing=`8` &moreResultsPage=`8` &showMoreResults=`1` &addJscript=`0` &extract=`1` &AS_showResults=`0` &grabMax=`10` &opacity=`.90` &highlightResult=`1` !]	
    


    Thanks for any help.
      • 5811
      • 1,717 Posts
      Go to http://www.modx.wangba.fr/your-test.html

      In this test &parents=`[[DocSwitcher]]` is used to switch from English documents (#61) to French documents (#62). These 2 disctintes hierarchies of document have the same father (#60).

      Choose English documents in the left menu and try to search "enfant" (child in French). As the search is limited to the English documents &parents=61) the french word (which is in a document in the hierarchy with &parents = 62) is not found.
      What do you mean by the search is global ? (from #0 ?) Could you me give some details on the hierarchy of documents where you search (#47) and where some unwanted words have been found.
        • 8416
        • 173 Posts
        I’m also working on a multi-language site. I tried your site and it seems to work fine for you...
        I have a directory structure for each language and I specify &parents to be the root of a given language. For instance I set &parent=`47` to narrow the search in only the directory structure under doc 47, but if I have &addJscript=`0`, the search will also look into document directory 100 and 60....

        I have something like that:
        Site Root
        -----> English (47)
        ----> More doc
        -------> French (100)
        --------> spanish (60)

        By the way I don’t get the drop down box below the Search text field when &addJscript=`0`. Is it correct?

        Thank for your help.
        • &addJscript puts the <script....></script> tags to load the MooTools library in the head of your page. This is mostly useful if you already have the MooTools library loaded for some other script. If you don’t have that of course the Ajax stuff won’t work. If you don’t want the Ajax, you’re better off using ajaxSearch=`0`.

          &AS_showResults=`0` tells it not to display the results on this page. You can’t have it both ways.

          Your problem may be the conflicting parameters in the snippet call. I suggest you carefully go over the parameter list in the README file that comes with the snippet.
            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
            • 8416
            • 173 Posts
            Thanks I got it now...
            One more thing though. The drop down search result list pushes the page contents to the bottom when it is displayed. How can I make it overlap a page contents by default?

            See http://www.modx.wangba.fr/your-test.html from coroico in Firebox. The search result windows pushed the page contents to the bottom.

            Thanks all for your help.

            • The block containing the search results has to be styled with position: absolute and then positioned, just like a drop-down menu.
                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
                • 5811
                • 1,717 Posts
                Echaland, from http://www.modx.wangba.fr/your-test.html , you can change the template from "relative" to "absolute". For that use the cssSwitcher on the left side menu. Just under the choice of documents.
                With "absolute" the ajaxsearch outputs overlap the current page. Try it !

                To download the css "relative" or "absolute" go to http://www.modx.wangba.fr/as171.html
                  • 8416
                  • 173 Posts
                  Perfect! Thanks for your super quick response.
                  Have a great week-end