Forum
YouTube Embed (iFrame) within a blog post
I want my user to be able to paste an iframe using the "Source" formatting option when writing a blog post. When I do this the video shows up, but the pasted code disappears. Is there a way around this?
Hi Danny, it's likely that CK Editor is removing the iframe tags. You can adjust the config to allow them not to be stripped out here: https://www.amixa.com/blog/2014/09/03/ckeditor-4-2-or-later-will-not-allow-iframe-or-other-html-tags/
But it might be just as easy (and perhaps nicer for your user) to add a YouTube video button instead: https://ckeditor.com/addon/youtube
Hi Simon, trying to add the YouTube button now. When I change the CKeditor config.js file, nothing seems to be happening. Do I have the correct folder structure? https://cl.ly/0T2u2Z2p1x1H
Yes, that's the right place, I added
config.extraPlugins = 'youtube';
at the end, just before the};
I had to empty the browser cache to see the new button.
Ah, sneaky browser caching. Got it, thanks!
I know! It had me stumped first time around :)