We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10669
    • 8 Posts
    Can you have two AjaxSeaches on one page?

    I want a all of site earch and a search that just searches one folder. Is there a way to have two searches on the one page that does not conflict with the other?

    I have tried to duplicate the snippet and change the name/folder but they search together.

    Any ideas?

    Modx 1.0.4
      • 10669
      • 8 Posts
      I think I may have found it.

      &asId
      Unique id for AjaxSearch instance
      Note: to distinguish several Ajaxsearch instances
      on the same page. The id is used to link the
      snippet calls between them. Choose a short
      name. eg: "as2". With the ajaxSearch mode, the
      first AS snippet call shouldn’t use the parameter
      &asId

      thanks me.
        • 5811
        • 1,717 Posts
        As example, look at this demo page.

        Keep in mind, that:
        - you should use the same release of ajaxSearch (You can’t mix the using of several AS versions on a same page).
        - the first AS call in the page shoudn’t use &asId
        - the second AS is possible ONLY with the non ajax mode (&ajaxSearch=`0`)