Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Tinymce removes the allowfullscreen attribute from the youtube share code (iframe tag).

Vote:
 

My costumer would like to copy the share code from youtube and then paste it into the wysiwyg html editor (tinymce - XhtmlString property), but
the problem is that the tinymce removes the allowfullscreen attribute from the iframe tag.

Does anyone know how to allow allowfullscreen attribute in the iframe tag?

Here is the sample code:

More info:

 




#172399
Edited, Dec 01, 2016 21:52
Vote:
 

Hey Rolle! Check out this link: http://cjsharp.com/blog/2013/04/15/how-to-add-valid-elements-like-iframes-to-tinymce-in-episerver-7/

The only minor change to that post is what Linus Ekström mentioned in the comments about ServerSideOnly.

So for your case, the class would look like this:

[TinyMCEPluginNonVisual(ServerSideOnly = true, PlugInName = "TinyMceExtendedValidElements", AlwaysEnabled = true, EditorInitConfigurationOptions = "{ extended_valid_elements: 'iframe[allowfullscreen|src|frameborder=0|alt|title|width|height|align|name]' }")]
public class TinyMceExtendedValidElements
{
}

You can add that anywhere in your project.

Then add the configuration in web.config:

<episerver>
	... some configuration ... 
	<tinyMCE mergedConfigurationProperties="valid_elements, extended_valid_elements, invalid_elements, valid_child_elements" />
</episerver>

And that's it!

#172754
Dec 10, 2016 7:06
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.