Jump to content

how do I implement support for iframe in HTML mode?


ozznixon
 Share

Recommended Posts

I did a few searches, however, was not able to find this - so sorry if I am repeating someone else's topic!

Today, I was asked to add an iframe to one of our pages - so we could push into the page data from another solution on the server. When I click on the

 button, and do <iframe ...></iframe> and click update it is removed.

Is there an easy way for a processwire beginner (but am a programmer) to implement support for this? (no idea where to look/tweak).

Thanks a lot!

Ozz

Link to comment
Share on other sites

Hi ozznixon,

The settings for TinyMCE are located in the field settings for whichever field you want to add this capability to. So, for the body field, go into Setup > Fields > body. Then go to the "INPUT" tab and click on "TinyMCE Advanced Configuration Options".

You'll want to edit the valid_elements to allow for iframes. I don't know off the top of my head how to do this... but if you're okay with allowing ALL elements, you can replace everything in the field with *[*] and that will allow iframes along with everything else. I usually do this although some people would caution against it... It really depends on how much power you want to give your editors.

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By joe_ma
      Sorry for asking this question here, but I cannot ask it in the VIP section because I use an version of FormBuilder that is expired.
      I have a fairly simple form on a website done with FormBuilder (PW 3.0.148, FormBuilder 0.2.4) that seems to work quite well. I've tested it with Firefox (88.0.1), Chrome, Opera, Edge and it works in all browsers as expected. The form is embedded in the page by pasting the name of the form in the body field.
      Now my customer tells me, that her Firefox (88.0.1) is blocking the page where the form is embedded: "Firefox may not open this page" for safety reasons.
      I have no clue as to what seems to be the problem here, since the form is on the same server and has the same domain.
    • By AndréPortuga
      Does anyone knows if there is a way of selecting a iframe inside a textfield(using ckEditor)? 
      I mean I have a Iframe with this code:
      <iframe allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" frameborder="0" height="315" scrolling="no" src="https://www.youtube.com/embed/PMaFJjZDrYM" width="100%"></iframe></p>
       
      but it's not getting responsive in iPhones.. So anyone know how can I select it via code for making it responsive?
       
      Thank you,
    • By tron1000
      Hello! I use PW 3.0.98 and I have frontend editing enabled for a PageTable Field. Somehow, when I double click the field in the frontend, the iframe in wich the content is displayed is very small (see screenshot). I couldn't find out if thats some CSS conflict or another problem. Any suggestions? Thanks, Andrej
       

    • By wes
      Having some issue with getting an iframe to save on a CKeditor text field (2.5.3). Things I've done to explicity allow it:
      - added "iframe[*]" to extraAllowedContent
      - added "IFrame" to the CKEditor toolbar
      - turned off CKEditor ACF
      - switched the field's "Content Type" from "Markup/HTML" to "Unknown" 
      When pasting in my iframe code (it's a Vimeo embed code), CKEditor shows the iframe placeholder, but after saving the page, it's stripped out. For testing, I tried adding a simpler iframe using CKEditor's iframe toolbar button, but that also gets stripped out after saving.
      Anyone experiencing this, or have iframes working with their field?
×
×
  • Create New...