Sitecore – iFrame attribute allowFullScreen removed

When I embed a youtube video in RTE “Edit Html”, the iframe tag remains unchanged…

<div id="newsFeaturedItem" class="embed-responsive embed-responsive-16by9"><iframe src="https://www.youtube.com/embed/TX4Cqjap7G4" width="560" height="315" frameborder="0" allowfullscreen></iframe></div>

I then click on “Show Editor”…”HTML” tab and the “allowfullscreen” attribute is removed.

SOLUTION:

According to Sitecore support, this behavior is default for Telerik’s RadEditor (it can be reproduced on their demo editor). It converts the contents of the field to XHTML, which removes some HTML5 attributes, including allowfullscreen.

As a workaround, you can perform the following:

1. Open the \sitecore\shell\Controls\Rich Text Editor\EditorPage.aspx file.

2. Replace this line:

ContentFilters="DefaultFilters"
with this one:
ContentFilters="RemoveScripts,FixUlBoldItalic,FixEnclosingP,IECleanAnchors,ConvertFontToSpan,IndentHTMLContent,EncodeScripts,OptimizeSpans,ConvertCharactersToEntities,PdfExportFilter,ConvertInlineStylesToAttributes,MozEmStrong,ConvertTags"
This will enable all filters except MakeUrlsAbsolute and ConvertToXhtml. After this, the allowfullscreen attribute will not be removed from the markup.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s