Is it possible to insert an iframe into the html of an RTE? | Community
Skip to main content
August 12, 2021
Solved

Is it possible to insert an iframe into the html of an RTE?

  • August 12, 2021
  • 3 replies
  • 2187 views

When I go to an RTE and put it into the HTML mode and insert an iframe, it doesn't seem to work. It looks like I doidn't paste any content into the HTML. I get ans error message like that when I close the "source edit" to save. I get an error message stating "please fill out this field" evethough I see the iframe content in the source editor...

Anybody tried inserting iframes in the RTE?

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Anudeep_Garnepudi

@henrimm 

RTE source validator will remove the iframe with source(src). Use Text Area if you are using RTE just for iframe.

 

-AG

3 replies

Asutosh_Jena_
Community Advisor
Community Advisor
August 13, 2021

Hi @henrimm 

 

You can include the iframe in RTE using the "Source Edit" option of RTE. Please see below where I am loading the iframe content.

 

 

Thanks!

Dipti_Chauhan
Community Advisor
Community Advisor
August 13, 2021

Hi @henrimm 

  As @asutosh_jena_  mentioned you can use sourceedit option to insert iframe. But please also check  WhitespaceProcessor.js, This removes some tags from RTE (It will happen when you switch back from source edit mode to normal) and XSS protection Framework (Will get called when you submit the dialog).

 

Thanks

Dipti

HenriMMAuthor
August 13, 2021

Thanks! As a matter of fact I used the source edit....but when I swiched back to normal, it erased the iframe. That happened also when embedding Twitter links in the RTE. Will share the whitespaceprocessor.js route with the team...

Anudeep_Garnepudi
Community Advisor
Anudeep_GarnepudiCommunity AdvisorAccepted solution
Community Advisor
August 14, 2021

@henrimm 

RTE source validator will remove the iframe with source(src). Use Text Area if you are using RTE just for iframe.

 

-AG

kautuk_sahni
Community Manager
Community Manager
August 17, 2021

@anudeep_garnepudi Good to see you back after a while. AEM Community missed your presence. Keep the momentum going. Looking forward to see you more now :).

Kautuk Sahni