We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4594
    • 74 Posts
    hello To all!

    first of all: sorry for my bad english, but it is not my native language....

    here my question:
    what is the best way to include an <iframe>-tag with its corresponding source-document.

    for example: i make a new document, then i’m in the html-editor (tiny) an want to include an iframe:

    <iframe frameborder="0" scrolling="no" src="myfile"></iframe>


    my source file (src="myfile") is in the document tree an i want to link on it. but in the editor, i can’t edit my <iframe> settings and in fact of this, i can’t link to anything.

    what is the best way to do something like this? has the source-document to be in the document tree? or is there a better way to do so?

    thank you for help!!

    greetz, captain!
      • 19638
      • 39 Posts
      Did you have try to edit the doc without tinyMCE ?
        • 4594
        • 74 Posts
        sorry for my late answer, but i was offline....

        @miniwark:
        yes, i tried that. i can for sure simply write my iframe tag by hand in the html view of the editor, or when the editor is disabled.

        for example:
        <iframe frameborder="0" scrolling="no" src="[~28~]"></iframe>


        so i can do that by hand, and its no problem for ME, the administrator an the site producer. BUT for the client, who does not know anything about html or how to directly link to the include page (via [~28~]), its will be a problem.

        so back to my (2) questions: is there a way in tinymce to include an iframe tag (and specify the parameters) within the wysiwyg-area? and is there another (better) way to include iframes and their source file?

        thanks for help!
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          You could make the <iframe> tags, along with most of the path to the filename, into a chunk, with a TV for the filename, then the client would just have to enter the filename into the TV when editing a document.
            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
            • 4594
            • 74 Posts
            @sottwell
            this would be fine, if i have the iframe tag on every site at the same place. but i want it to be flexible: include an iframe in the content, but not on every site and in different places in the content area.

            but i cant do that if i make it like this:

            the chunk:
            <iframe frameborder="0" scrolling="no" src="[*iframesrc*]"></iframe>


            maybe i’m wrong, but i have to include the chunk into the template? and so it is "static". or am i blind?

            greetz, captain