Expand my Community achievements bar.

SOLVED

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

Avatar

Level 1

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?

HenriMM_0-1628801982928.png

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@HenriMM 

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

 

-AG

View solution in original post

5 Replies

Avatar

Community Advisor

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.

 

asutosh_jena_0-1628824779796.png

asutosh_jena_1-1628824807255.png

 

Thanks!

Avatar

Community Advisor

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

Avatar

Level 1

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...

Avatar

Correct answer by
Community Advisor

@HenriMM 

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

 

-AG

Avatar

Administrator

@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