Linked content and components
- Linked items elements are used to reference other content items.
- Rich text elements are used to compose your content with text, images, components, and content items. Components and content items are useful for inserting structured content into a specific point in the text.
Components in Kontent.ai
- A component is a single-use content item.
- Just like content items, components are based on a specific content type.
- Unlike content items, components exist only within rich text elements.
- If a component and a content item are based on the same content type, they have the same structure. This applies both in the UI and API.
Retrieve linked content
When retrieving items, the contents of all components and content items in the rich text and linked items elements are stored in themodular_content object property of the API response.
When enumerating the items, the modular_content object property contains only components.
The individual components and content items within the modular_content object property aren't ordered. See linked items and rich text elements for details on how ordering is done within the elements.
For historical reasons, the property is called "modular_content" instead of "linked_content".
Linked content depth
Content items can reference other content items using linked items or rich text elements. These linked items can reference other items recursively. By default, the API returns only one level of linked items.- To include more than one level of linked items in response, set the
depthquery parameter to 2 or more. - To exclude all linked items, set the
depthquery parameter to 0.
depth query parameter as they are an integral part of their rich text element. Components are always present in the API response. Components can be nested up to six levels deep.