Components

Components in Type CMS are reusable groups of elements that can be included in multiple templates. They allow you to manage common content elements from a central location, ensuring consistency and simplifying updates. When a component is modified, changes are automatically reflected across all templates that use it. This reduces redundancy, streamlines content management, and improves efficiency by eliminating the need to redefine common elements for each template.


get

List components

List all components in a project

Required attributes

projectId
string
Your projectId

Optional attributes

None
Request
get
/api/projects/:projectId/types?alias=blocks
Response

get

Retrieve a component

Retrieves a single component based on the provided component ID

Required attributes

projectId
string
Your project ID
componentId
string
The ID of the component to retrieve

Optional attributes

None
Request
get
/api/projects/:projectId/types/:componentId?alias=blocks
Response

post

Create a component

Creates a new component

Required attributes

projectId
string
Your project ID
title
string
The name of the new component

Optional attributes

description
string
A description for the new component
Request
post
/api/projects/:projectId/types?alias=blocks
Response

patch

Update a component

Updates attributes and content schema for a component.

Required attributes

projectId
string
Your project ID
componentId
string
The ID of the component to retrieve

Optional attributes

title
string
The name for the component
description
string
A description for the component
items
cmitemobject[]
An array of component items
Request
patch
/api/projects/:projectId/types/:componentId?alias=blocks
Response

delete

Delete a component

Deletes a component from your project. Use this method with caution, deleting a component will also remove it from all associated entries.

Required attributes

projectId
string
Your project ID
componentId
string
The ID of the component to remove

Optional attributes

None
Request
delete
/api/projects/:projectId/types/:componentId?alias=blocks
Response

get

Clone a component

Clones a component based on the provided component ID

Required attributes

projectId
string
Your project ID
componentId
string
The ID of the component to remove

Optional attributes

None
Request
get
/api/projects/:projectId/types/:componentId/clone?alias=blocks
Response
Last modified 7/6/2024, 7:49:25 PM