Jump to content

iframe gets removed from wysiwyg field


dicabrio
 Share

Recommended Posts

I have a page with a text field that is displayed as wysiwyg editor (tinyMCE). When I add some source code like <iframe src="//www.youtube.com/embed/EdNWOlnGtrk" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe>. Save the code then save the page the iframe is removed. If I do it again (add the iframe to the source code) then save the page. The iframe is there on the frontend. If I then save it again it is removed again. It looks like not being a setting of tinyMCE, but I'm not sure.

 

Using PW 3.0.277

Link to comment
Share on other sites

It seems silly, because I do the following

- Open page

- Add iframe

- Save page

- Iframe gone on the rendered page

- Add iframe (the edit page was still open)

- Save the page

- Iframe is visible on the rendered page

- Change something on the page in the CMS (kept it open)

- Save the page

- iframe gone

 

So this keeps on repeating. Hanna Code is not a solution for this problem at the moment as I have a lot of content already with iFrames.

Link to comment
Share on other sites

I would recommend you keep your iframe seperate from your other content. Make two fields. Check the Settings for each.

  1. For the iframe, use a Textarea without any Text Formatters. You can echo this on the frontend and get the exact HTML code you put in that field.
  2. For content with HTML markup, use a Textarea with the HTML Entity Encoder Text Formatter.

I use this approach all the time for any kind of embed codes. You can treat iFrames in a similar manner.

  • Like 1
Link to comment
Share on other sites

Yes tried it myself. Works by disabling the purifier. In that regard something is still going wrong. If I enable purifier the iframe is stripped only sometimes and not always. So something is happening there. @Inxentas keeping iframes separate from the content, as I do agree, is not an option at the moment.

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.
×
×
  • Create New...