isSingleton property in a content type
isSingleton property helps keep consistency in a content type by ensuring that only one page of a particular content type exists in the Headless CMS. For example, implementing this property in a Home Page content type prevents the creation of multiple pages of the same content type and ensures that any updates to the Home Page layout are reflected on one page.
Follow the steps below to add the
isSingleton property to the store.
- Go to the store repository and access
- Choose a content type and set the
true. For example:
"name": "Home Page",
- Sync your changes in the
CMSfolder by running the following command:
vtex cms sync
Once you've synced your changes, go to your store Admin and select Storefront > Headless CMS. Here, you can:
Check the content type
Access Headless CMS and search for the content type to which you added the
isSingleton property, such as a Home Page. You will notice that you cannot duplicate the content, only change its status to Publish, Draft, or Unpublish.
Create the content type
Access Headless CMS, select
CREATE NEW, and choose the content type to which you added the