SaaS CMS has officially launched! Learn more now.

Configuring editors for your properties


In EPiServer 7, you can configure custom editors for your properties, ref:

But what if the drop down list items depends on property settings data?
I'm basically looking for a way to get the settings object (and still use the new ui), similar to this:

var settings = PropertyData.GetSetting(typeof(TagSelectorSettings)) as TagSelectorSettings;


I assume this can be fetched from the EditorDescriptor class or the meta data object, but I haven't found a method to use.



Jan 22, 2013 17:31

You can try casting the model to a PropertyData object. This is an extract of how we set up the Tiny MCE editor:

public override void ModifyMetadata(EPiServer.Shell.ObjectEditing.ExtendedMetadata metadata, IEnumerable<Attribute> attributes)
            base.ModifyMetadata(metadata, attributes);

            //Grab property data
            var propertyData = metadata.Model as PropertyData;

if(propertyData == null)
{return;}//Always check for null after "as" statement

            //Load settings
            TinyMCESettings propertySettings = (TinyMCESettings)propertyData.GetSetting(typeof(TinyMCESettings));


Jan 22, 2013 20:30

Thanks, Linus! I'll try that. :)

Jan 24, 2013 15:00
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.