Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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

HenriMM
Level 1
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
Anudeep_Garnepudi
Correct answer by
Community Advisor
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
Asutosh_Jena_
Community Advisor
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!

Dipti_Chauhan
Community Advisor
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

HenriMM
Level 1
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...

Anudeep_Garnepudi
Correct answer by
Community Advisor
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

kautuk_sahni
Community Manager
Community Manager

@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 :).