Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Did you inherit from EPiServer.Cms.TinyMce.Core.XhtmlStringEditorDescriptor ?
Does
var content = metadata.FindOwnerContent();
also returns null?
Hi Michał,
I have no answer direct to you question, but it is a recommendation try using ContentArea and block type instead of the generic PropertyList as your current implementation, see https://world.optimizely.com/documentation/developer-guides/CMS/Content/Properties/generic-propertylist/
Regards,
OK, I managed to fix this.
Solution would be available in CMS UI 11.36.2
Stay tuned!
Available here: https://nuget.optimizely.com/package/?id=EPiServer.CMS.UI&v=12.0.2
Let's say that I have two page content types PageA and PageB. Both of them are having property defined like that:
[EditorDescriptor(EditorDescriptorType = typeof(CollectionEditorDescriptor<OfferDetailsItem>))] public override IList<OfferDetailsItem> OfferDetailsItems { get; set; }
with OfferDetailsItem defined like that:
public class OfferDetailsItem { [Display(Order = 1)] public string Label { get; set; } [Display(Order = 2)] public XhtmlString Value { get; set; } [Display(Order = 3)] public bool Large { get; set; } } [PropertyDefinitionTypePlugIn] public class OfferDetailsItemPropertyList : PropertyList<OfferDetailsItem> { }
I would like to customize TinyMCE editor for Value property of OfferDetailsItem class. I would like to do this depending on page context so there is different toolbar config when its used on PageA and different when its used on PageB.
I tried to use CustomEditorDescriptor for XhtmlString TargetType and override:
public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes)
but in this case metadata.Parent is null so I can't reach content page context. For properties that are not collections this is possible.
Do you know if there is any other way to deal with this?