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?
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.
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.
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.
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:
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.
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?
The RTE itself should behave for richtext - TVs and the content-field the same.
It's much more likely to be a parsing order issue than a problem with the RTE.