Skip to content

Commit

Permalink
Merge pull request #43 from vtex/fix/loc/10269
Browse files Browse the repository at this point in the history
updated and added files according to task LOC-10269.
  • Loading branch information
mariana-caetano authored May 1, 2023
2 parents e796d3a + 7f4513e commit d3d5193
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline


### Documentation
* Fixed: Using isSingleton property in a contenty type.md according to task LOC-10269.

* Fixes of i18n on file Using the onlySettings property in a content type.md according to task LOC-10268.

Expand Down
15 changes: 7 additions & 8 deletions blog/2023-04-06-cms.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
---
title: "New property for creating a single page of a content type"
description: "Create a single page for a content type with the new `isSingleton` property, ensuring consistency and preventing duplication of layout updates."
description: "Headless CMS now has the isSingleton property for creating single content pages, avoiding duplicates, and keeping 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.
The `isSingleton` property is now available for merchants to create a single page of a content type in the Headless CMS. This property prevents the creation of multiple pages of the same content type, ensuring that any updates made to the content type layout are consistent across all requests.

![singleton-en](https://user-images.githubusercontent.com/67270558/230461926-6944c58e-60f2-4857-82d3-43ee507cac4e.gif)
![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.
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 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.
With the `isSingleton` property, you can keep consistency across the content types in your store by preventing the creation of multiple pages with the same content type. This ensures that any updates to the page 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.
The change enables consistency in the content of a page. The `isSingleton` property prevents the creation of multiple pages of the same content type and ensures updates to the page layout are reflected in all requests.

## What needs to be done?
Refer to the [Using `isSingleton` property in a content type](https://www.faststore.dev/how-to-guides/cms/vtex-headless-cms/Using%20isSingleton%20property%20in%20a%20contenty%20type) documentation for more information.

For more information, please refer to the [Using `isSingleton` property in a content type](https://www.faststore.dev/how-to-guides/cms/vtex-headless-cms/Using%20isSingleton%20property%20in%20a%20contenty%20type) documentation.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# 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.
# Using the `isSingleton` property in a content type
The `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.

![singleton-en](https://user-images.githubusercontent.com/67270558/230461926-6944c58e-60f2-4857-82d3-43ee507cac4e.gif)
![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:
## Step-by-step instructions
1. Go to the store repository and access `CMS` > `content-types.json`.
2. Choose a content type and set the `isSingleton` property as `true`. For example:

```json
{
Expand All @@ -16,19 +16,17 @@ Follow the steps below to add the `isSingleton` property to the store.
"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:
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 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**.
### 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 `isSingleton` property.
### Create the content type
Access **Headless CMS**, select `CREATE NEW`, and choose the content type to which you added the `isSingleton` property.

1 comment on commit d3d5193

@vercel
Copy link

@vercel vercel bot commented on d3d5193 May 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.