London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
We implement IContentApiModelFilter in a more simple fasion, allowing us to perform better SOC in the end, see https://docs.developers.optimizely.com/content-management-system/v1.5.0-content-delivery-api/docs/how-to-customize-data-returned-to-clients
This will in it's most simple form look something like this
public class PageBaseFilter : IContentApiModelFilter
{
public void Filter(ContentApiModel contentApiModel, ConverterContext converterContext)
{
if (contentApiModel.ContentLink != null)
{
contentApiModel.Properties.Add("Id", contentApiModel.ContentLink.GuidValue.ToString());
}
// more more more
}
}
Hi all,
Currently I am looking into customizing the response of the content delivery api by adding new properties.
For now I was able to achieve something of that sort by overriding the ContentConvertingService class.
I would like to know if there is a better approach to add custom properties to the content delivery api.