Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Stop Editor from replacing embed tags with inline media control View modes: 
User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 5/18/2012 2:54:23 PM
   
Stop Editor from replacing embed tags with inline media control
Is there a way to stop the content editor from replacing embed tags pasted in the source code with the inline media control? It rarely works with many video embed code snippets that my clients try to use and they are getting very frustrated.

User avatar
Member
Member
kentico_edwardh - 5/19/2012 10:17:18 AM
   
RE:Stop Editor from replacing embed tags with inline media control
Hello,

By default, in editable regions we convert embed tags to a control macro. When the page is rendered, this is resolved to html that will display the video correctly for the detected browser in most cases.

If you would like to change this behavior so that the embed tags are not automatically converted, you can modify the following file in your web project: ~\CMSAdminControls\FCKeditor\fckconfig.js

Note that if you modify this, you will lose the 'InsertImageOrMedia' dialog options in the toolbar.

1. Comment out this line:
FCKConfig.Plugins.Add('InsertImageOrMedia', 'en,cs');
//change to:
//FCKConfig.Plugins.Add('InsertImageOrMedia', 'en,cs');

2. From the following section, remove: 'InsertImageOrMedia',
FCKConfig.ToolbarSets["Default"] = [
['Source', '-', 'Preview'],
['Cut', 'Copy', 'Paste', 'PasteText', 'PasteWord', '-', 'Print'],
['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'],
['Bold', 'Italic', 'Underline', 'StrikeThrough', '-', 'Subscript', 'Superscript'],
['OrderedList', 'UnorderedList', '-', 'Outdent', 'Indent'/*, 'Blockquote'*/],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyFull'],
['InsertLink', 'Unlink', 'Anchor'],
['InsertImageOrMedia', 'QuicklyInsertImage', 'Table', 'Rule', 'Smiley', 'SpecialChar', 'PageBreak'],
['InsertBizForms', '-', 'InsertInlineControls', '-', 'InsertPolls', '-', 'InsertRating', '-', 'InsertYouTubeVideo'],
'',
'/',
['Style', 'FontFormat', 'FontName', 'FontSize'],
['TextColor', 'BGColor'],
//['AutoSave'],
['FitWindow', 'ShowBlocks'] // No comma for the last row.
];

3. Save the above changes then clear browser cookies and restart any browsers you're testing your site with.

Best Regards,
Edward Hillard

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 7/12/2012 3:26:29 PM
   
RE:Stop Editor from replacing embed tags with inline media control
I can't lose the insert images or media options. That's absurd. Can't I just prevent it from replacing embed code with Kentico's code? This is getting very frustrating as I have clients that need to put video embed code into their content that aren't from YouTube or Vimeo.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 7/17/2012 7:25:35 AM
   
RE:Stop Editor from replacing embed tags with inline media control
Hi,

Please open this file: \CMSAdminControls\FCKeditor\editor\plugins\InsertImageOrMedia\fckplugin.js

On line 494 there is an ELSE statement you need to modify and escape the embed code replacement logic to fit your need.

Best regards,
Juraj Ondrus