We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24981
    • 109 Posts
    I have tried to use the FAQ Snippet from Etomite. I am getting the following result...

    Parse error: parse error, unexpected T_STRING in /home/mail2gro/public_html/manager/includes/document.parser.class.inc.php(661) : eval()’d code on line 2
    ___

    Does anyone know if this Snippet is working in MODx?

    Richard
      • 18397
      • 3,250 Posts
      ModX should be fully backwards compadible with Etomite. Which TP are you running?
        • 17393
        • 19 Posts
        There’s a problem with the snippet library stripping backslashes. So if you have copied the code directly from the snippet library, it will not work.
        See this thread in the etomite forums.
        • That’s the problem; and also the snippet author not following recommended coding practices.

          Line 2:
          $output = "<script type="text/javascript"> ...
          


          Either you have the quotes in the output string escaped with a backslash ( \"text/javascript\" ) or you use single quotes, either for the outer level or the inner level of quotes:

          $output = "<script type='text/javascript'> ...
          


          Looking at the code in this snippet, the author used every variation possible!
            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
            • 24981
            • 109 Posts
            I changed to the other FAQ snippet: NeatFAQ

            and it works fine.

            Richard
              • 7455
              • 2,204 Posts
              Snippets made for 0.6.1 and 2 do not work all the time on Mod-X there are some new api calls that Mod-X does not support
                follow me on twitter: @dimmy01