Hi Faris,
Looking at requirements (use case) for your project an approach, you could use a custom content provider.
In order to do this you just need to create your custom content type and inherit from IContent.
I would way up the benefits of the custom content providers before you finalise your approach as it has some pros and cons.
Once you have the custom content provider implemented you should be able to use the Content Delivery API as normal to retrieve the data.
Let me know if you need anymore help on this.
Thanks
Paul
Just like Paul sais you'll need the IContent inheritance, I do however wonder you you plan to find your content since the delivery API require a contentID or an URL to the content you are fetching.
Wouldn't it just be more simple to create a custom API endpoint that will serve the items from your external API?
Hi everyone,
I’m working on an Optimizely project (headless), and I have a specific use case where I need to create a new content type (similar to
PageData
orBlockData
) that is neither a page nor a block. Essentially, I want to define a custom content type to hold data for items retrieved from an external API, but I don’t want to generate a separate page for each item.Is it possible to push data into this custom content type and then retrieve it via the Content Delivery API?
Any advice or direction on how to approach this ?
do let me know if the question needs further clarification.