AI OnAI Off
You can not directly do that for the property on a block which is used as property on another block. You need to create a custom EditorDescriptor inheriting from XhtmlStringEditorDescriptor. Then apply that on your property like [UIHint(ProductDetailsEditorDescriptor.UIHint)]
Let me know if you need sample code example?
Let me add sample code that will help you
Create a class
using System;
using System.Collections.Generic;
using EPiServer.Cms.TinyMce.Core;
using EPiServer.Core;
using EPiServer.ServiceLocation;
using EPiServer.Shell.ObjectEditing;
using EPiServer.Shell.ObjectEditing.EditorDescriptors;
[EditorDescriptorRegistration(
TargetType = typeof(XhtmlString),
EditorDescriptorBehavior = EditorDescriptorBehavior.OverrideDefault,
UIHint = UIHint)]
public class ProductDetailsEditorDescriptor : XhtmlStringEditorDescriptor
{
public const string UIHint = "PropertyListXhtmlString";
public ProductDetailsEditorDescriptor(ServiceAccessor<TinyMceConfiguration> tinyMceConfiguration)
: base(tinyMceConfiguration) { }
public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes)
{
base.ModifyMetadata(metadata, attributes);
if (!metadata.EditorConfiguration.ContainsKey("settings")) return;
var settings = (TinyMceSettings)metadata.EditorConfiguration["settings"];
if (settings == null) return;
settings.AddPlugin(DefaultValues.EpiserverPlugins, "code contextmenu image table template");
settings.Toolbar(
"fontsizeselect bold italic underline strikethrough subscript superscript epi-link image epi-image-editor code",
"table template bullist numlist outdent indent alignleft aligncenter alignright alignjustify searchreplace fullscreen help");
settings.Width(450);
settings.Height(200);
settings.Resize(TinyMceResize.Vertical);
}
}
And, apply it to your property as attribute
UIHint(ProductDetailsEditorDescriptor.UIHint)]
public virtual XhtmlString Column1 { get; set; }
Let me know if anything not clear
Thanks
I have a page with a "local" block. (Block used as a property on a page). This block has a XhtmlString property. But I can not change the configured TinyMCE editor for this property.
I tried used the documented approach (https://world.episerver.com/documentation/developer-guides/CMS/add-ons/customizing-the-tinymce-editor-v2/default-settings/), but this failed.