We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6696
    • 145 Posts
    I have a code that I am trying to add to my index page in Modx.

    <iframe src="http://www.google.com/calendar/embed?title=Saint%20Amelia%20School&amp;showTitle=0&amp;showDate=0&amp;mode=AGENDA&amp;height=270&amp;wkst=1&amp;bgcolor=%23ffffff&amp;src=stamelia2999%40gmail.com&amp;color=%23A32929&amp;ctz=America%2FNew_York" style=" border:solid 1px #777 " width="230" height="270" frameborder="0" scrolling="no"></iframe>

    How do I add this with a TV?

    thanks,
    Daniel

      • 7327
      • 195 Posts
      That might work with a Chunk + TV.
        • 6696
        • 145 Posts
        I just want to add a google calendar. How do I stop Modx from stripping the code? It hates iFrames.

        Daniel
          • 28042 ☆ 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).
            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
            • 7327
            • 195 Posts
            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.
              • 6696
              • 145 Posts
              I and pasting it into the HTML editor but it strips it out.

              Daniel
              DDG

                • 6696
                • 145 Posts
                Is there a way to turn off the html ’cleanup’ so I can just paste what code I need?

                Daniel
                  • 3749
                  • 24,544 Posts
                  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.
                    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
                    • 6696
                    • 145 Posts
                    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?
                      • 28042 ☆ 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
                      Calendar=={{chunkname}}
                        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