That might work with a Chunk + TV.
I just want to add a google calendar. How do I stop Modx from stripping the code? It hates iFrames.
Daniel
-
☆ A M B ☆
- 24,524 Posts
That’s not MODx, that’s the TinyMCE rich text editor. MODx doesn’t care about things like iframes or any other HTML structures. If you put that in a chunk and use the chunk tags in your content then it will work. Or put the code directly into a TV (not a Rich Text type TV, of course, just a plain textarea TV).
Oh you’ve been pasting it on to the rich text editor? Switch to the plain text editor before pasting that piece of code in. Or go for the chunk like what Susan said.
I and pasting it into the HTML editor but it strips it out.
Daniel
DDG
Is there a way to turn off the html ’cleanup’ so I can just paste what code I need?
Daniel
Quote from: daviat at Dec 02, 2010, 09:08 PM
Is there a way to turn off the html ’cleanup’ so I can just paste what code I need?
Daniel
Are you using the HTML editor inside TinyMCE? That won’t stop Tiny from mangling the code.
You need to uncheck the rich text checkbox and save the document, then reload it. That way you’ll be working in raw HTML. If you need to use TinyMCE, then do as Susan suggests and put the code in a chunk and put a chunk tag for that chunk on the page.
BTW, if you have any PHP code in that section, it needs to be moved into a snippet or MODx will strip it out.
I need a WYSIWYG interface because my client will be updating it. The things is I am having trouble adding the chunk. How do I build the chunk to add this iFrame? Do I just cut and past the Google Calendar code in the chunk and save it?
-
☆ A M B ☆
- 24,524 Posts
Yes. Just put the whole <iframe>...</iframe> block into a chunk.
If you may want this on some pages but not others, make a check box TV with a caption "Load Calendar", and when the editor checks the box the calendar will be added where the TV tags are placed in the template or content.
The iframe will still be in a chunk, and the TV’s Input Option Values field will have the chunk name