We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19781
    • 6 Posts
    I am a new guy uphere so:
    - Firstly, This is great CMS, I have tried a lot before, this one really impress me, great interface, great idea with Ajax integration, growing community, development. I am really getting into it.
    - Secondly, as in the subject.I have no idea how to make the search box work(wit searchajax snippet) in cacheable pages. Is there any way to make it work, or is there another way to disable the ajaxsearch and set result page directly after user hit the search button

    Regards
    martin
      • 14050
      • 788 Posts
      The non-ajax way:

      Put the ajax call for your search somewhere in your template like this:

      [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`LANDING_NUMBER_HERE`&extract=`1` &showMoreResults=`1` &extract=`0`&AS_showResults=`0`!]

      Then create a document for the search results (use this document ID in the call above). In the content of the document, place this call:

      [!AjaxSearch? &AS_showForm=`0` &ajaxSearch=`0` &extract=`1`!]
        Jesse R.
        Consider trying something new and extraordinary.
        Illinois Wine

        Have you considered donating to MODx lately?
        Donate now. Every contribution helps.
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        In a cacheable page, any interactive snippets should be called uncached: [!SnippetName? ... !]
          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