We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38357
    • 178 Posts
    Hello,
    I am trying to insert a HTML form in a richtext TV without much success. Is this possible?
    I have a richtext TV in which I have some HTML displaying images and some text. This all works OK. However, I also want to display a HTML form which I have placed in a chunk. If I call the chunk with [[$MyChunk]] using the richtext HTML editor it won't display correctly.
    Calling the same chunk in the *content area works perfectly so it would seem that it isn't the chunk code but where it is being placed or the TV options?
      • 42562
      • 1,145 Posts
      The so-called rich text editor on the TV is garbling up your code. Click source on that RTE and see what is going on with that [[$word]] [ed. note: donshakespeare last edited this post 11 years, 5 months ago.]
        TinymceWrapper: Complete back/frontend content solution.
        Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
        5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
        • 46886
        • 1,154 Posts
        Not sure if this is an acceptable solution, but I turn off the editor on many resources for this reason, it often screws with code, especially stuff like snippet and chunk calls.

        But you can't just click the checkbox at bottom, you have to go to settings and uncheck the editor button. Its a bit of a pain but the workaround is easy enough.
          • 19872
          • 1,078 Posts
          Maybe consider calling the form chunk using a TV selector.
          *myForm_selector
          TV input type: Checkbox
          TV input: Show My Form==[[$formChunkName]]||
          Allow empty: Yes
          Output: Defaul

          Call *myFormSelector directly above or below your [[*content]] call, thus keeping it within the same html wrapper that wraps your content.

          This will be almost as if you were inserting the form chunk call in the content region.

          I think with a rich text editor, it gets a bit tricky, though doable. There's always a risk that p tags or span tags might get thrown in around the form chunk call, as you edit other text in the content field.
            • 3749
            • 24,544 Posts
            Before trying the stuff below, I'd try turning off the richtext editor and looking at the HTML code that's left after it's turned off. That will tell you if the RTE is mangling the code. If the RTE is not the problem:

            You can try changing the "Pre-process tags in Property Values" checkbox on the "Properties" tab of the TV.

            You can also try this:

            [[!$MyChunk]] 


            That will delay the processing of the chunk and its content. There may be placeholders in the chunk that are not set at the time the TV is processed.

              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 38357
              • 178 Posts
              Thanks for the suggestions - I'll give them a try.
              It seems strange to me that the same RTE doesn't mangle the same chunk code when editing in Content?
                • 4172
                • 5,888 Posts
                The RTE itself should behave for richtext - TVs and the content-field the same.
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 3749
                  • 24,544 Posts
                  It's much more likely to be a parsing order issue than a problem with the RTE.
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting