We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51038
    • 9 Posts
    I'm having a problem saving resources or chunks with iframes in them. I'm not using a text editor at all.

    Both resources and chunks save just fine when I remove the iframes, and templates will save with the iframes on them (and show up as expected on the site). At the moment this means that any page with iframes requires a separate template - I can live with that if I have to, but I'm worried it might be a symptom of some deeper problem.

    This question has been answered by multiple community members. See the first response.

    • discuss.answer
      • 13428 ☆ A M B ☆
      • 1,031 Posts
      If you are not able to save i.e. resources and chunks containing special code, you are often facing a mod_security issue.

      If you can't solve it yourself with the hints on Installation on a server running ModSecurity, I suggest that you contact your ISP and search with them a solution.
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        It's odd that he can save it in a template, though, just not a chunk or resource. And usually mod_security will abort the entire form submission process, not strip it out and go ahead and save the rest.
          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
          • 13428 ☆ A M B ☆
          • 1,031 Posts
          He can't save resources and chunks with iframe code in it. The code is not stripped, if I read his question above right. During saving a template mod_security is not triggered for some reason.

          But it could be a different reason too, I.e. a local antivirus application.
          • discuss.answer
            • 51038
            • 9 Posts
            Yes, that's what I meant - the code wasn't getting stripped, the entire save was failing for chunks and resources when an iframe was present.

            My host has kindly dealt with this for me - I had triggered a modsec rule (or perhaps about five of them).

            I wonder if I set off the rule because of a configuration error - when I first installed MODX, although I changed the name of the core .htaccess (and successfully redirected changelog to a 404, as per the dashboard warning message), I hadn't yet edited the content of the .htaccess, and the warning message was still present - I got rid of the message later, but by then I think I had already tried to use iframes. A cautionary tale, perhaps, about ignoring config warnings.

            @Jako - BTW, I'm the same guy who posted this problem on Stack Overflow, although that was before I found I was able to use iframes in templates without trouble - thanks for your advice.
              • 13428 ☆ A M B ☆
              • 1,031 Posts
              Good that you solved it with the help of your ISP.