diff --git a/blog/2023-04-06-cms.md b/blog/2023-04-06-cms.md new file mode 100644 index 000000000..9b0783c53 --- /dev/null +++ b/blog/2023-04-06-cms.md @@ -0,0 +1,22 @@ +--- +title: "New property for creating a single page of a content type" +description: "Headless CMS now has isSingleton property to create single content page, avoid duplicates, and keep layout consistent across requests." +tags: [cms] +--- + +The `isSingleton` property is now available for merchants to create a single page of a content type in the Headless CMS. The property prevents the creation of multiple pages of the same content type, which ensures that any updates made to the content type's layout are consistent across all requests. + +![gif-singleton](https://user-images.githubusercontent.com/67270558/228011883-b3d03a63-79c5-4a2c-8fb7-667ca19f56a4.gif) + +## What has changed? + +Previously, when creating or editing a content type without the `isSingleton` property, the content type page could be duplicated in multiple versions. This could cause issues when trying to update the correct version or could result in multiple content types with the same name but different content, leading to confusion during content management. + +With the introduction of the `isSingleton` property, your store's content types can maintain consistency by preventing the creation of multiple pages of the same content type. This ensures that any updates to the page's layout are reflected in all requests, streamlining your content management process. + + +## Why are we making this change? +The change enables consistency in a content type’s content. The `isSingleton` property prevents the creation of multiple pages of the same content type and ensures updates to the page's layout are reflected in all requests. + +## What needs to be done? +Refer to the [Using `isSingleton` property in a content type](/tbd) documentation for more information. diff --git a/docs/how-to-guides/cms/vtex-headless-cms/Using isSingleton property in a content type.md b/docs/how-to-guides/cms/vtex-headless-cms/Using isSingleton property in a content type.md new file mode 100644 index 000000000..529900a80 --- /dev/null +++ b/docs/how-to-guides/cms/vtex-headless-cms/Using isSingleton property in a content type.md @@ -0,0 +1,32 @@ +# Using `isSingleton` property in a content type +The `isSingleton` property helps maintain 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 would prevent the creation of multiple pages of this content type and ensure that any updates to the Home Page layout are reflected on one page. + +![gif-singleton](https://user-images.githubusercontent.com/67270558/228011883-b3d03a63-79c5-4a2c-8fb7-667ca19f56a4.gif) + +Follow the steps below to add the `isSingleton` property to the store. + +## Step-by-step +1. Go to the store's repository and access `CMS` > `content-types.json`. +2. Choose your desired content type and add the `isSingleton` property as `true`. For example: + +```json + { + "id": "home", + "name": "Home Page", + "configurationSchemaSets": [], + "isSingleton": true + }, +``` +3. Sync your changes in the `CMS` folder by running the following command: +``` +vtex cms sync +``` + +Once you've synced your changes, go to your store's Admin and select **Storefront > Headless CMS**. Here, you can: + +### Check the content type: +Access **Headless CMS** and search for the content type on which you added the `isSingleton` property, such as a Home Page content type. 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 `isSingleton` property. diff --git a/static/data/releases.json b/static/data/releases.json index 6101ed7b6..2057baa98 100644 --- a/static/data/releases.json +++ b/static/data/releases.json @@ -1,4 +1,10 @@ [ + { + "title": "New property for creating a single page of a content type", + "product": "CMS", + "fileName": "2023-04-06-cms", + "description": "Headless CMS now has isSingleton property to create single content page, avoid duplicates, and keep layout consistent across requests." + }, { "title": "New Calendar Views to manage Releases", "product": "CMS",