Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hey everyone,

I've been trying to allow iframes in CKEditor by adding them to the toolbar. I've been making changes to the config.js (couch/includes/ckeditor/) with zero results.

I added this block of code within the CKEDITOR.editorConfig function, but it doesn't appear to do anything.
Code: Select all
   config.toolbar = [
                                [ 'Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript' ],
                                [ 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ],
                                [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote' ],
                                [ 'Undo', 'Redo', 'RemoveFormat' ],
                                '/',
                                [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord' ],
                                [ 'Image', 'Table', 'Iframe', 'HorizontalRule', 'Smiley', 'SpecialChar' ],
                                [ 'Link', 'Unlink', 'Anchor' ],
                                '/',
                                [ 'Styles', 'Format', 'Font', 'FontSize' ],
                                [ 'TextColor', 'BGColor' ],
                                [ 'inlinesave']
                            ];


Looking around in the couch folder I noticed scripts.php (addons/inline/view) defines a bunch of toolbars for CKEditor, but changing those also did not seem to have any effect.

If you have any ideas, please let me know!

Thanks,

Sam
Hi Sam,

I am afraid but the richtext region will not allow IFRAME elements.
It is a security measure.
KK wrote: Hi Sam,

I am afraid but the richtext region will not allow IFRAME elements.
It is a security measure.


Is this a security measure in place at CouchCMS level, or CKeditor (I noticed cke has a plugin for iframe)?

Thanks,
Sam


UPDATE:
The restriction is in HTMLParser.php in the 'parser' folder. Adding 'iframe' to the safe_tags array allows me to add iframes in richtext fields now. (Note: Obviously don't mess around with couch files if your site is live production)
3 posts Page 1 of 1
cron