Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Can't get ListItemUIHint to work with custom type

Vote:
 

I followed the docs at https://docs.developers.optimizely.com/content-management-system/docs/property-value-list but I can't get my custom editor to work witin a list using ListItemUIHint.

I have a custom inline block type defined as this:

[ContentType(AvailableInEditMode = false, GUID = "808cffcb-be56-4870-8804-31bfd8c2f8a3")]
public class EstateIdentifierProperty : BlockData {
    public virtual string? Identifier { get; set; }
    public virtual string? Description { get; set; }
    public virtual string? ThumbnailUrl { get; set; }
}

For which I have created a custom property editor which I register like this.

[EditorDescriptorRegistration(TargetType = typeof(EstateIdentifierProperty), UIHint = "EstateIdentifier")]
public class EstateIdentifierPropertyEditorDescriptor : EditorDescriptor {
    private const string _editingClient = "cool-project/editors/estate-identifier-editor";

    public EstateIdentifierPropertyEditorDescriptor() : base() {
        ClientEditingClass = _editingClient;
    }

    public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes) {
        ClientEditingClass = _editingClient;

        base.ModifyMetadata(metadata, attributes);
    }
}

I then added this property to my page

    [Display(Name = "Single Custom Editor", Order = 4)]
    [UIHint("EstateIdentifier")]
    public virtual EstateIdentifierProperty? EstateIdentifier1 { get; set; }

Which in turn renders my custom editor fine as seen below.

Now I want to have multiple of these so I tried using the new "ListItemUIHintAttribute" to get this editor in a collection like this.

    [ListItemUIHint("EstateIdentifier")]
    public virtual IList<EstateIdentifierProperty> EstateIdentifiers { get; set; } = new List<EstateIdentifierProperty>();

But this just renders a plan editor like below.

Is this supposed to be supported with "ListItemUIHintAttribute"? If it is, what am I missing?

/ Karl-Johan Sjögren

#309694
Edited, Sep 29, 2023 9:40
Vote:
 

It should be the name of the property on the block in this case Identifier

#309716
Sep 29, 2023 18:41
Vote:
 

The name of the property on the block? I don't understand what you mean by that. Should I set the ListItemUIHintAttribute on the "Identifier" property in my block?

#309830
Oct 02, 2023 5:34
Vote:
 

Yes or whatever other property you want to show on the list.  You only can show one property.

#309838
Oct 02, 2023 14:33
Vote:
 

No lists can handle complex objects since 12.18.0 as described in https://world.optimizely.com/blogs/bartosz-sekula/dates/2023/1/official-list-property-support/. There they also talk about using "ListItemUIHint" to use a custom editor for your list items which is what I'm trying to do.

#309878
Oct 03, 2023 4:33
* 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.