We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26270
    • 5 Posts
    I am having an issue with the TinyMCE editor changing "&" to "&" (without quotes), which is making it hard to include Snippets with any parameter calls into a document. For example, I want to include the Ajax Search Snippet into one of my documents (rather than creating a new template). I’ve tried using the HTML view within TinyMCE, as well as changing the "editor to use" to none, but nothing seems to be working. Whenever I change the editor to none, the editor returns with the altered content after saving.

    This:
    [!AjaxSearch? &ajaxSearch=`0` &showPagingAlways=`1` &AS_descriptionShow=`1` &AS_showForm=`0`!]

    Turns Into This:
    [!AjaxSearch? &ajaxSearch=`0` &showPagingAlways=`1` &AS_descriptionShow=`1` &AS_showForm=`0`!]

    Anyone have any advice on how to fix this?

    Thanks so much,
    Sean
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Yes, it does that. You can use a config file instead; the only parameter you need in the snippet is the config=`file-name`, and all the rest go in the config file in the form of ordinary PHP variable definitions $param = ’value’;

      Or you can put the snippet call in a chunk and just put the chunk tags in your content.
        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
        • 26270
        • 5 Posts
        Sottwell,

        Interesting. So, I assume that the config file would be a regular PHP file that would need to be uploaded to the server? I’ll have to play around with this a bit. I had thought of putting the call in a chunk, but I didn’t want to end up with a lot of extra "templates", but this might be the easier way to go since users other than myself (who do not have FTP access) might need to place similar calls.

        Thanks for your help and suggestions.

        Sean
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Unfortunately the people at MoxieCode just can’t seem to conceive of a situation where someone wouldn’t want TinyMCE to do that, so they hard-coded the "feature" and refuse to consider that maybe it should be a configuration setting instead.
            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
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            I don’t see why the config file couldn’t be a document as well; although your PHP would have to be configured to allow using a URL in an include or require statement.
              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