Optimizely CMS unfortunately used TinyMCE v4 which does not have this function. The v4 docs are here: https://www.tiny.cloud/docs-4x/plugins/paste/#options
You may be able to get some of the desired effects with the paste_as_text and paste_data_images but you will need to experiment with these and see if this causes more issues for the CMS editors.
Thanks for that Mark, I completely missed I was looking at the wrong version. I have tried instead to use paste_as_text and paste_data_images but it seems to have no effect and does not disable the drag and drop of media items
.AddPlugin("paste", (settings, content, propertyName) =>
{
settings["paste_data_images"] = false;
settings["paste_as_text"] = true;
})
Does anyone have any further ideas as to how I can go about disabling drag and drop in the tinyMCE editor??
You can use an editor descriptor to set the allowed types (AllowedTypes attribute does not work for XhtmlString). The example below makes so that only pages can be dragged and dropped into the text.
[EditorDescriptorRegistration(TargetType = typeof(XhtmlString), EditorDescriptorBehavior = EditorDescriptorBehavior.Default)]
public class XhtmlStringsEditorDescriptor : EditorDescriptor
{
public XhtmlStringsEditorDescriptor()
{
AllowedTypes = new[] { typeof(PageData) };
}
}
Hello,
I need to disable the ability to drag and drop media files (or indeed any files) into the tinyMCE editor, I have added the following code which is based on the following documentation but it doesn't look to do anything at all, and I am still able to drag and drop.
The above was taken based on the following TinyMCE documentation
paste_block_drop
Due to browser limitations, it is not possible to filter content that is dragged and dropped into the editor. When
paste_block_drop
is set to true the plugin will disable drag and dropping content into the editor. This prevents the unfiltered content from being introduced. Copy and paste is still enabled.Default value:
false
Possible values:
true
,false
Does anyone have any idea why this is not working, or has someone else implemented the required functionality in the same/different manner.