Try our conversational search powered by Generative AI!

TinyMCE issue

Vote:
 

I'm experiencing something very strange.

I've tried to implement custom TinyMCE settings so I've created the following class : 

[ServiceConfiguration(ServiceType = typeof(PropertySettings))]
public class MyTinyMCESettings : PropertySettings
{


public MyTinyMCESettings ()
{
DisplayName = "Americares Simple Editor";
}

public override TinyMCESettings GetPropertySettings()
{
var settings = new TinyMCESettings();

settings.ToolbarRows.Add(new ToolbarRow(new string[]
{
TinyMCEButtons.Anchor,
TinyMCEButtons.EPiServerLink, TinyMCEButtons.Unlink, TinyMCEButtons.Image,
TinyMCEButtons.EPiServerImageEditor, TinyMCEButtons.Media, TinyMCEButtons.EPiServerPersonalizedContent,
TinyMCEButtons.Cut, TinyMCEButtons.Copy, TinyMCEButtons.Paste, TinyMCEButtons.PasteText,
TinyMCEButtons.PasteWord, TinyMCEButtons.Fullscreen, TinyMCEButtons.SuperScript,
TinyMCEButtons.SubScript,
TinyMCEButtons.Underline, TinyMCEButtons.JustifyCenter,
TinyMCEButtons.JustifyLeft, TinyMCEButtons.JustifyRight, TinyMCEButtons.JustifyFull,
TinyMCEButtons.HorizontalRow, TinyMCEButtons.FormatSelect, "twitterquotebutton", "customimageeditorbutton"
}));
settings.ToolbarRows.Add(new ToolbarRow(new string[]
{
TinyMCEButtons.Bold, TinyMCEButtons.Italic, TinyMCEButtons.Separator, TinyMCEButtons.BulletedList,
TinyMCEButtons.NumericList, TinyMCEButtons.StyleSelect, TinyMCEButtons.Undo, TinyMCEButtons.Redo,
TinyMCEButtons.Separator,
TinyMCEButtons.Search, TinyMCEButtons.FontSelect, TinyMCEButtons.FontSizeSelect,
TinyMCEButtons.ForeColor, TinyMCEButtons.ForeColorPicker
}));

// Add the default non-visual plugins that replaces built in functionality with EPiServer specifics.
settings.NonVisualPlugins.Add("advimage");
settings.NonVisualPlugins.Add("epifilebrowser");

settings.ToolbarRows[1].Buttons.Add(TinyMCEButtons.Code);

settings.Height = 300;
settings.Width = 580;

return settings;
}

public override System.Guid ID
{
get { return new System.Guid("37ABF48F-8DFC-4C28-BD23-1E14655F6526"); }
}

}

On the desired properties I've put the MyTinyMCESettings tag.

But sometimes when I try to create a block which has a property annotated with the custom settings class I experience something strange.

That property is being displayed in the cms as a text area and i cannot even write text on it . I also get a script error as you can see in the following images : 

I get this only if i try to create a new block from clicking " create a new block" within a CONTENT AREA.  If however I try to create the same block from the Assets Pane the behaviour is normal and i dont get the errors..

#199168
Nov 19, 2018 9:08
* 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.