From 36fa58385367d12d65ebe735493364263b08fc08 Mon Sep 17 00:00:00 2001 From: Pierre Wizla Date: Tue, 25 Feb 2025 16:26:12 +0100 Subject: [PATCH 1/7] Update Content Manager to editing Relations on the fly --- docusaurus/docs/cms/features/content-manager.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus/docs/cms/features/content-manager.md b/docusaurus/docs/cms/features/content-manager.md index b7d04235cb..a06e219a53 100644 --- a/docusaurus/docs/cms/features/content-manager.md +++ b/docusaurus/docs/cms/features/content-manager.md @@ -504,7 +504,7 @@ Entries from multiple-choice relational fields can be reordered, indicated by a :::tip - Not all entries are listed by default: more can be displayed by clicking on the **Load more** button. Also, instead of choosing an entry by scrolling the list, you can click any relational field drop-down list and type to search a specific entry. -- Click on the name of an entry to be redirected to the edit view of the relational field's content-type. Make sure you save your page first, to avoid losing your last modifications. +- Click on the name of an entry to display a modal from where you will be able to edit the relational field's content-type. For now, you can only edit a relation on-the-fly, and not create a new one. ::: :::note From 577dba5e345480c68be1be7f72249abe7007e2c5 Mon Sep 17 00:00:00 2001 From: Pierre Wizla Date: Tue, 25 Feb 2025 16:41:38 +0100 Subject: [PATCH 2/7] Mention beta flag --- docusaurus/docs/cms/features/content-manager.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus/docs/cms/features/content-manager.md b/docusaurus/docs/cms/features/content-manager.md index a06e219a53..692215c547 100644 --- a/docusaurus/docs/cms/features/content-manager.md +++ b/docusaurus/docs/cms/features/content-manager.md @@ -504,7 +504,7 @@ Entries from multiple-choice relational fields can be reordered, indicated by a :::tip - Not all entries are listed by default: more can be displayed by clicking on the **Load more** button. Also, instead of choosing an entry by scrolling the list, you can click any relational field drop-down list and type to search a specific entry. -- Click on the name of an entry to display a modal from where you will be able to edit the relational field's content-type. For now, you can only edit a relation on-the-fly, and not create a new one. +- Click on the name of an entry to display a modal from where you will be able to edit the relational field's content-type. For now, you can only edit a relation on-the-fly, and not create a new one. This feature is currently in beta and only available if you installed Strapi with the beta flag, with the following command `npx create-strapi@beta`. ::: :::note From 97b78fa15ad00ba243c30cb29c578cbec93c13a7 Mon Sep 17 00:00:00 2001 From: Pierre Wizla Date: Mon, 3 Mar 2025 14:46:48 +0100 Subject: [PATCH 3/7] Update docusaurus/docs/cms/features/content-manager.md --- docusaurus/docs/cms/features/content-manager.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus/docs/cms/features/content-manager.md b/docusaurus/docs/cms/features/content-manager.md index 692215c547..a06e219a53 100644 --- a/docusaurus/docs/cms/features/content-manager.md +++ b/docusaurus/docs/cms/features/content-manager.md @@ -504,7 +504,7 @@ Entries from multiple-choice relational fields can be reordered, indicated by a :::tip - Not all entries are listed by default: more can be displayed by clicking on the **Load more** button. Also, instead of choosing an entry by scrolling the list, you can click any relational field drop-down list and type to search a specific entry. -- Click on the name of an entry to display a modal from where you will be able to edit the relational field's content-type. For now, you can only edit a relation on-the-fly, and not create a new one. This feature is currently in beta and only available if you installed Strapi with the beta flag, with the following command `npx create-strapi@beta`. +- Click on the name of an entry to display a modal from where you will be able to edit the relational field's content-type. For now, you can only edit a relation on-the-fly, and not create a new one. ::: :::note From 4a4776519a5e1182803c1533c0c7f0f5bb45ebeb Mon Sep 17 00:00:00 2001 From: Pierre Wizla Date: Mon, 3 Mar 2025 15:02:31 +0100 Subject: [PATCH 4/7] Remove unnecessary comma to test flag detection via GH actions --- .../managing-relational-fields.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 docusaurus/docs/user-docs/content-manager/managing-relational-fields.md diff --git a/docusaurus/docs/user-docs/content-manager/managing-relational-fields.md b/docusaurus/docs/user-docs/content-manager/managing-relational-fields.md new file mode 100644 index 0000000000..4ce3c7ba25 --- /dev/null +++ b/docusaurus/docs/user-docs/content-manager/managing-relational-fields.md @@ -0,0 +1,103 @@ +--- +title: Managing relational fields +description: Instructions to manage relation-type fields, called "relational fields", which establish a relation between two content-types. +sidebar_position: 4 +tags: +- Content-type Builder +- collection type +- components +- relations +- one-choice relational fields +--- + +# Managing relational fields + +Relation-type fields added to a content-type from the Content-type Builder allow establishing a relation with another collection type. These fields are called "relational fields". + +The content of relational fields is written from the edit view of the content-type they belong to (see [Writing content](writing-content.md)). However, relational fields can point to one or several entries of the other collection type, this is why in the Content Manager it is possible to manage a content-type's relational fields to choose which entries are relevant. + +
+Example + +In my Strapi admin panel I have created 2 collection types: + +- Restaurant, where each entry is a restaurant +- Category, where each entry is a type of restaurant + +I want to assign a category to each of my restaurants, therefore I have established a relation between my 2 collection types: restaurants can have one category. + +In the Content Manager, from the edit view of my Restaurant entries, I can manage the Category relational field, and choose which entry of Category is relevant for my restaurant. +
+ + + +The relational fields of a content-type are displayed among regular fields. For each relational field is displayed a drop-down list containing all available entry titles. It allows to choose which entry the relational fields should point to. You can either choose one or several entries depending on the type of relation that was established. + +:::tip +Not all entries are listed by default: more can be displayed by clicking on the **Load more** button. Also, instead of choosing an entry by scrolling the list, you can click any relational field drop-down list and type to search a specific entry. +::: + +:::note +If the Draft & Publish feature (see [Saving, publishing and deleting content](saving-and-publishing-content.md)) is activated for the content-type the relational field belongs to, you will notice blue or green dots next to the entries names in the drop-down list. They indicate the status of the entry, respectively draft or published content. +::: + +:::caution +If the [Internationalization plugin](/user-docs/plugins/strapi-plugins#i18n) is installed, the list of entries may be limited or differ from one locale to another. Only relevant entries that can possibly be chosen for a relational field will be listed. +::: + +## Managing one-choice relational fields + +Many-to-one, one-to-one, and one-way types of relation only allow to choose one entry per relational field. + + + +To select the only relevant relational field's entry: + +1. In the content-type's edit view, click on the drop-down list of the relational field. +2. Among the list of entries, choose one. + +:::tip +You can click on the name of the selected entry to be redirected to the edit view of the relational field's content type. Make sure you save your page first, to avoid losing your last modifications. +::: + +To remove the entry selected in the drop-down list, click on the delete button . + +## Managing multiple-choice relational fields + +Many-to-many, one-to-many, and many-ways types of relation allow to choose several entries per relational field. + + + +To select the relevant relational field's entries: + +1. In the content-type's edit view, click on the drop-down list of the relational field. +2. Among the list of entries, choose one. +3. Repeat step 2 until all relevant entries have been chosen. + +:::tip +All selected entries are listed right below the drop-down list. Click on the name of an entry to display a modal from where you will be able to edit the relational field's content-type. For now, you can only edit a relation on the fly, and not create a new one. This feature is currently in beta and only available if you installed Strapi with the beta flag with the following command `npx create-strapi@beta`. +::: + +To remove an entry, click on the cross button in the selected entries list. + +Entries from multiple-choice relational fields can be reordered, indicated by a drag button . To move an entry, click and hold it, drag it to the desired position, then release it. From 07891650ebca0f11d054936532c32ad595d1d2aa Mon Sep 17 00:00:00 2001 From: Pierre Wizla Date: Mon, 3 Mar 2025 15:04:30 +0100 Subject: [PATCH 5/7] Revert "Remove unnecessary comma" This reverts commit 4a4776519a5e1182803c1533c0c7f0f5bb45ebeb. --- .../managing-relational-fields.md | 103 ------------------ 1 file changed, 103 deletions(-) delete mode 100644 docusaurus/docs/user-docs/content-manager/managing-relational-fields.md diff --git a/docusaurus/docs/user-docs/content-manager/managing-relational-fields.md b/docusaurus/docs/user-docs/content-manager/managing-relational-fields.md deleted file mode 100644 index 4ce3c7ba25..0000000000 --- a/docusaurus/docs/user-docs/content-manager/managing-relational-fields.md +++ /dev/null @@ -1,103 +0,0 @@ ---- -title: Managing relational fields -description: Instructions to manage relation-type fields, called "relational fields", which establish a relation between two content-types. -sidebar_position: 4 -tags: -- Content-type Builder -- collection type -- components -- relations -- one-choice relational fields ---- - -# Managing relational fields - -Relation-type fields added to a content-type from the Content-type Builder allow establishing a relation with another collection type. These fields are called "relational fields". - -The content of relational fields is written from the edit view of the content-type they belong to (see [Writing content](writing-content.md)). However, relational fields can point to one or several entries of the other collection type, this is why in the Content Manager it is possible to manage a content-type's relational fields to choose which entries are relevant. - -
-Example - -In my Strapi admin panel I have created 2 collection types: - -- Restaurant, where each entry is a restaurant -- Category, where each entry is a type of restaurant - -I want to assign a category to each of my restaurants, therefore I have established a relation between my 2 collection types: restaurants can have one category. - -In the Content Manager, from the edit view of my Restaurant entries, I can manage the Category relational field, and choose which entry of Category is relevant for my restaurant. -
- - - -The relational fields of a content-type are displayed among regular fields. For each relational field is displayed a drop-down list containing all available entry titles. It allows to choose which entry the relational fields should point to. You can either choose one or several entries depending on the type of relation that was established. - -:::tip -Not all entries are listed by default: more can be displayed by clicking on the **Load more** button. Also, instead of choosing an entry by scrolling the list, you can click any relational field drop-down list and type to search a specific entry. -::: - -:::note -If the Draft & Publish feature (see [Saving, publishing and deleting content](saving-and-publishing-content.md)) is activated for the content-type the relational field belongs to, you will notice blue or green dots next to the entries names in the drop-down list. They indicate the status of the entry, respectively draft or published content. -::: - -:::caution -If the [Internationalization plugin](/user-docs/plugins/strapi-plugins#i18n) is installed, the list of entries may be limited or differ from one locale to another. Only relevant entries that can possibly be chosen for a relational field will be listed. -::: - -## Managing one-choice relational fields - -Many-to-one, one-to-one, and one-way types of relation only allow to choose one entry per relational field. - - - -To select the only relevant relational field's entry: - -1. In the content-type's edit view, click on the drop-down list of the relational field. -2. Among the list of entries, choose one. - -:::tip -You can click on the name of the selected entry to be redirected to the edit view of the relational field's content type. Make sure you save your page first, to avoid losing your last modifications. -::: - -To remove the entry selected in the drop-down list, click on the delete button . - -## Managing multiple-choice relational fields - -Many-to-many, one-to-many, and many-ways types of relation allow to choose several entries per relational field. - - - -To select the relevant relational field's entries: - -1. In the content-type's edit view, click on the drop-down list of the relational field. -2. Among the list of entries, choose one. -3. Repeat step 2 until all relevant entries have been chosen. - -:::tip -All selected entries are listed right below the drop-down list. Click on the name of an entry to display a modal from where you will be able to edit the relational field's content-type. For now, you can only edit a relation on the fly, and not create a new one. This feature is currently in beta and only available if you installed Strapi with the beta flag with the following command `npx create-strapi@beta`. -::: - -To remove an entry, click on the cross button in the selected entries list. - -Entries from multiple-choice relational fields can be reordered, indicated by a drag button . To move an entry, click and hold it, drag it to the desired position, then release it. From 2f3e9fe575e7034a4d0bfc7799762d5a3dbf9676 Mon Sep 17 00:00:00 2001 From: Pierre Wizla Date: Mon, 3 Mar 2025 15:05:33 +0100 Subject: [PATCH 6/7] Fix beta version --- docusaurus/docs/cms/features/content-manager.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus/docs/cms/features/content-manager.md b/docusaurus/docs/cms/features/content-manager.md index a06e219a53..611de5013f 100644 --- a/docusaurus/docs/cms/features/content-manager.md +++ b/docusaurus/docs/cms/features/content-manager.md @@ -504,7 +504,7 @@ Entries from multiple-choice relational fields can be reordered, indicated by a :::tip - Not all entries are listed by default: more can be displayed by clicking on the **Load more** button. Also, instead of choosing an entry by scrolling the list, you can click any relational field drop-down list and type to search a specific entry. -- Click on the name of an entry to display a modal from where you will be able to edit the relational field's content-type. For now, you can only edit a relation on-the-fly, and not create a new one. +- Click on the name of an entry to display a modal from where you will be able to edit the relational field's content-type. For now, you can only edit a relation on-the-fly and not create a new one. This feature is currently in beta and only available if you installed Strapi with the beta flag with the following command `npx create-strapi@beta`. ::: :::note From c277b657bea3a7f83200e591c8e3efa832e2ac1a Mon Sep 17 00:00:00 2001 From: Pierre Wizla Date: Mon, 3 Mar 2025 15:23:20 +0100 Subject: [PATCH 7/7] Update docusaurus/docs/cms/features/content-manager.md --- docusaurus/docs/cms/features/content-manager.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus/docs/cms/features/content-manager.md b/docusaurus/docs/cms/features/content-manager.md index 611de5013f..5744d54d83 100644 --- a/docusaurus/docs/cms/features/content-manager.md +++ b/docusaurus/docs/cms/features/content-manager.md @@ -504,7 +504,7 @@ Entries from multiple-choice relational fields can be reordered, indicated by a :::tip - Not all entries are listed by default: more can be displayed by clicking on the **Load more** button. Also, instead of choosing an entry by scrolling the list, you can click any relational field drop-down list and type to search a specific entry. -- Click on the name of an entry to display a modal from where you will be able to edit the relational field's content-type. For now, you can only edit a relation on-the-fly and not create a new one. This feature is currently in beta and only available if you installed Strapi with the beta flag with the following command `npx create-strapi@beta`. +- Click on the name of an entry to display a modal from where you will be able to edit the relational field's content-type. For now, you can only edit a relation on-the-fly and not create a new one. This feature is currently in beta and only available if you installed Strapi with the beta flag, with the following command `npx create-strapi@beta`. ::: :::note