We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2912
    • 315 Posts
    I’ve been trying to setup NewsEditor and NewsManager to deal with creating and modifying content on my news section. Everything is working as I would like but for one little hiccup.

    Whenever I add a chunk, snippet, placeholder or [~~] the code is being stripped out.

    Is NewsEditor/NewsManager the best way to do this? Is there a way to stop the stripping?

    I’ve tried to edit NewsEditor to prevent the stripping but everything I’ve done has failed. I’m actually only looking to use this method to add links via tinyMCE and the linklist.

    I’m using modx 1.0.3, php 5.2.11, apache 2.0.64.

    I’ve tried a site search and good search but haven’t found a solution yet. Any help would be appreciated.

    EDIT: I’ve tested a few things with RTE and standard text areas and using a plugin to display the content and either way the detail I want to keep gets stripped out. Next step is to see if the info gets into the database inteact if the content is not put through a plugin.

    It sesems as though no matter what is entered in input fields the output hitting the database gets stripped. Is there any solution for this?
      BBloke
      • 30023
      • 172 Posts

      Its only an educated guess but it may be this line:

      $formTpl = $modx->mergePlaceholderContent($modx->mergeChunkContent($formTpl));

      that strips the snippets etc, without running them. Have a look in the API documentation or in document.parser.inc.php to check.

      -- Tim.
        • 4172
        • 5,888 Posts
        I think it has todo with modx_sanitize_gpc() in /manager/includes/protect.inc.php
        and you can post modx-tags only if IN_MANAGER_MODE is true.

        one way is to create a module for saving your posted data and send them per ajax.
        You have to be logged in at manager to post datas to that module from frontend. There is a frontend-manager-login snippet anywhere.


          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 2912
          • 315 Posts
          Thanks you two. At least I know where to look now. It was sending me a little crazy.

            BBloke
            • 30023
            • 172 Posts
            This may be going off on a tangent, but if you are trying to input MODx tags via the front end that may not actually be the best way to go, as you appear to be mixing logic and content.

            Developers use code - and can access the templates/chunks in the backend for this purpose, whilst the content editors do not (or at least, probably should not).

            -- Tim.