We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10405
    • 288 Posts
    I have an AjaxSearch set up in the body of a test page as follows:

    [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`70`!]

    Page ID 70 is my searchresults.html. The call code on this page is:

    [!AjaxSearch? &ajaxSearch=`0` &AS_showForm=`0` &tplResults=`{{resultsholder}}` &tplResult=`{{resultholder}}` !]

    This all works fine, but I want to place this functionality in a header area which appears on all pages.

    I tried placing the [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`70`!] in the template header area, but instead of redirecting to the searchresults.html page, the results come up below the search form, in the actual header on the same page.

    How can I sort it so that the search input and button are in the header on each page, but when I do the search, the results appear in the searchresults.html? I would have the &AS_landing=`70` bit would mean it should forward to that page.

    thanks
      • 22840
      • 1,572 Posts
      Heres what I use

      In the header
      [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`11`&AS_showResults=`0`!]

      Nnd in the search result page:
      <h2>Search Results</h2>
      [!AjaxSearch? &ajaxSearch=`0` &AS_showForm=`0`!]
        • 10405
        • 288 Posts
        Just adding your &AS_showResults=`0` into the header seems to have done the trick- many thanks. smiley