kontent-ai / delivery-sdk-php

Kontent.ai Delivery SDK for PHP
https://kontent.ai
MIT License
46 stars 15 forks source link

Added support for content components #68

Closed petrsvihlik closed 6 years ago

petrsvihlik commented 6 years ago

Motivation

The goal is to add support for content components (non-reusable content). From the SDKs point of view, the components behave the same as regular content items. However, they are supported only in the rich-text elements.

<object type="application/kenticocloud" data-type="component" data-codename="n55afed3a_b4a3_018a_8744_3b06301b1f88"></object>

The only difference is that the value of the data-type attribute is not item but component. (There is no new endpoint for Content components in the Delivery API). The components are being sent as a part of the modular content (linked items) dictionary in the same format as the regular modular content.

Sample implementation: https://github.com/Kentico/delivery-sdk-net/pull/131/files

Checklist

How to test

Make sure rich-text elements containing components get resolved in the same manner as standard content items. Testing KC project: https://qa-deliver.global.ssl.fastly.net/ab44e0cc-9302-00c3-14ce-1362a118ad2f/items

Internal reference: DC-544

petrsvihlik commented 6 years ago

fixed in https://github.com/Kentico/delivery-sdk-php/commit/23e879e2cb6b00570c0fa5da104359cb4a73570c