Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
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 override the Resolve method of IPropertyConvertorProvider - if you post your code i can help to see what is missing,
I have my Property Converter :
public class TitleBodyPropertyConverter : IPropertyConverter
{
public IPropertyModel Convert(PropertyData propertyData, ConverterContext contentMappingContext)
{
throw new NotImplementedException();
}
}
which I am not completely sure how to map my property to the content api property and because of that I can't implement the Resolve method. For now the Resolve method is empty:
public class TitleBodyPropertyConverterProvider : IPropertyConverterProvider
{
public IPropertyConverter Resolve(PropertyData propertyData)
{
//if (propertyData == yourPropertyModel)
//{
// return yourPropertyConverter;
//}
return null;
}
public int SortOrder { get; }
}
You seems to have taken the right approach
Have you created the PropertyModel to be return from IPropertyConverter
YourPropertyModel : PropertyModel<IList<T>, PropertyList<T> ?
and then in Resolve you can check if propertyData is of type PropertyList<T>
It should work.
Thank you @Muhanned for your response.
With the latest version of the Content Delivery API it's enough to have your custom property model YourPropertyModel : PropertyModel<IList<T>, PropertyList<T> and it works. No need for the IPropertyConverter to be implemented. At least in my case.
I had a corrupted DB and that's why nonthing works what ever I tried.
Hello,
I am trying to create the custom property in the page type and fetch that property with the rest of the page's property via Content Delivery API.
This post is exactly what I need https://world.optimizely.com/blogs/K-Khan-/Dates/2018/7/use-of-ilist-in-episerver-content-delivery-api/ but that is for the API v1.
Basically what I need is that this page custom property :
[Display(
GroupName = SystemTabNames.Content,
Name = "Panel List",
Order = 30)]
[EditorDescriptor(EditorDescriptorType = typeof(CollectionEditorDescriptor<TitleBody>))]
public virtual IList<TitleBody> Panels { get; set; }
serialize into the API response.
Does anybode have any advise how to do that?
I tried with IPropertyConverterProvider but the documentation is non existant and I miss a few parts there.
Thanks.