Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
Last time I checked there wasn't a built in configuration builder similar to what you could find in PageTypeBuilder.
If you have an existing PropertySetting or creating one at startup I guess you can use an EditorDescriptor to set your configuration.
Checkout EPiServer.Cms.Shell.UI.ObjectEditing.EditorDescriptors.XhtmlStringEditorDescriptor in the EPiServer.Cms.Shell.UI (usually found in the Modules-path among your VPP) for some inspiration.
public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes)
{
base.ModifyMetadata(metadata, attributes);
TinyMCESettings settings = (TinyMCESettings) ((PropertyData) metadata.Model).GetSetting(typeof (TinyMCESettings));
ExtendedMetadata mostContentMetadata = ExtendedMetadataExtensions.FindTopMostContentMetadata(metadata);
IContent content = mostContentMetadata != null ? mostContentMetadata.Model as IContent : (IContent) null;
TinyMCEInitOptions tinyMceInitOptions = new TinyMCEInitOptions(TinyMCEInitOptions.InitType.EditMode, settings, content);
if (metadata.IsReadOnly)
{
tinyMceInitOptions.InitOptions["readonly"] = (object) true;
tinyMceInitOptions.InitOptions["body_class"] = (object) "mceReadOnly";
}
metadata.EditorConfiguration.Add("width", tinyMceInitOptions.InitOptions["width"]);
metadata.EditorConfiguration.Add("height", tinyMceInitOptions.InitOptions["height"]);
metadata.EditorConfiguration.Add("settings", (object) tinyMceInitOptions.InitOptions);
}
Hi,
Is it possible to decorate propertis with property settings?
I have property settings for a custom property and would like to specify those settings on my properties, it's quite cumbersome to go into admin mode and set those settings.