We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18367
    • 834 Posts
    I’ve had this problem a few times.

    When I type in a snippet call, save the page then view it in the browser all I see is the actual code of the snippet.

    I’ve tried turning off the editor, I’ve even retyped in the call manually (sometimes this works, but not always.)

    At the moment I’m trying to get Ajax Search doing some optional things.

    Here’s the call

    <p>[!AjaxSearch? &language=`english-utf8`&whereSearch=`products,stocks,providers`
    &documents=`1,2,3,4,5,6,7,8,9,10,11,12`
    &filter=`name,iphone,10|pvd_name,Nokia,10`
    &order=`name`
    &extract=`99:description`
    &config=`owntables-2`
    &searchWordList=`owntables-2WordList`
    &stripOutput=`saveHtml`
    &tplLayout=`@FILE:assets/snippets/AjaxSearch/templates/outputMultipleList/layout.tpl.html`
    &tplAjaxResult=`@FILE:assets/snippets/AjaxSearch/templates/owntables-2AjaxResult.tpl.html'!]</p>


    And here’s what it looks like in the browser

    [[AjaxSearch? &language=`english-utf8`&whereSearch=`products,stocks,providers` &documents=`1,2,3,4,5,6,7,8,9,10,11,12` &filter=`name,iphone,10|pvd_name,Nokia,10` &order=`name` &extract=`99:description` &config=`owntables-2` &searchWordList=`owntables-2WordList` &stripOutput=`saveHtml` &tplLayout=`@FILE:assets/snippets/AjaxSearch/templates/outputMultipleList/layout.tpl.html` &tplAjaxResult=`@FILE:assets/snippets/AjaxSearch/templates/owntables-2AjaxResult.tpl.html']]


    Does anyone know why this keeps happening and what to do to fix it?

    It’s driving me nuts.

    Thanks
      Content Creator and Copywriter
      • 25483
      • 741 Posts
      Check your code for ’ where it has to be ` (you got one in your code)
      I also changed the "&amp;" to "&"... but it should both work smiley

      try this code:

      <p>[!AjaxSearch? &language=`english-utf8` &whereSearch=`products,stocks,providers` &documents=`1,2,3,4,5,6,7,8,9,10,11,12` &filter=`name,iphone,10|pvd_name,Nokia,10` &order=`name` &extract=`99:description` &config=`owntables-2` &searchWordList=`owntables-2WordList` &stripOutput=`saveHtml` &tplLayout=`@FILE:assets/snippets/AjaxSearch/templates/outputMultipleList/layout.tpl.html` &tplAjaxResult=`@FILE:assets/snippets/AjaxSearch/templates/owntables-2AjaxResult.tpl.html`!]</p>

        with regards,

        Ronald Lokers
        'Front-end developer' @ h2o Media

        • 18367
        • 834 Posts
        Thanks, but
        Check your code for ’ where it has to be ` (you got one in your code)

        That’s either a bit too cryptic, or I’m too new to understand what you mean.


        As for the "&amp;" to "&", as I said, I already tried that via turning off the editor and manually retyping the call. It makes no difference, and as you said both will work as I have other snippets with &amp; and they work fine.

        What I have done in the meantime is put the entire snippet on one line, and that seems to make it work.
          Content Creator and Copywriter
          • 25483
          • 741 Posts
          Quote from: markg at Aug 20, 2008, 06:52 AM

          Thanks, but 
          Check your code for ’ where it has to be ` (you got one in your code)

          That’s either a bit too cryptic, or I’m too new to understand what you mean.


          As for the "&amp;" to "&", as I said,  I already tried that via turning off the editor and manually retyping the call. It makes no difference, and as you said both will work as I have other snippets with &amp; and they work fine.

          What I have done in the meantime is put the entire snippet on one line, and that seems to make it work.

          Take a look at this code:
          &tplAjaxResult=`@FILE:assets/snippets/AjaxSearch/templates/owntables-2AjaxResult.tpl.html'


          You see the ’ at the end of the line?
          That should be a `

          And maybe it was like you said... just put everything on a single line wink
            with regards,

            Ronald Lokers
            'Front-end developer' @ h2o Media

            • 18367
            • 834 Posts
            Media Guy,

            oh one of those things; a ` instead of an ’

            Thanks, I never would have spotted that. Changed it, but doesn’t seem to have made any difference.

            Putting everything on one line definitely makes it work, though.
              Content Creator and Copywriter
              • 22303 MODX Staff
              • 10,725 Posts
              The current parser does not allow (or recognize) line-breaks within a tag; this is why it happens. The parser in Revolution will not have this limitation.