Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions docusaurus/docs/cms/features/content-type-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,33 @@ Configuring the basic settings of the Relation field consists in choosing with w

</Tabs>

:::tip Modeling nested page hierarchies
To model a navigable tree of pages:
1. Add a `Page` collection type with a "Slug" (UID) and (optionally) an "Order" (Integer) field to control sibling ordering.
2. Create a Relation field from `Page` to `Page` and choose *Many-to-one* so each page can set its "Parent page". Strapi automatically provides the inverse "Children pages" relation.
3. When reading data, populate `children` recursively to load the tree. Keep the recursion depth small to avoid large responses.

<details>
<summary>Example</summary>
```json title="Populate nested children for a page tree"
{
populate: {
children: {
fields: ['title', 'slug'],
populate: {
children: {
fields: ['title', 'slug'],
},
},
},
},
}
```
</details>

The same populate pattern works with GraphQL or the Document Service API (see [Understanding populate guide](/cms/api/rest/guides/understanding-populate#populate-several-levels-deep-for-specific-relations)).
:::

#### <img width="28" src="/img/assets/icons/v5/ctb_boolean.svg" /> Boolean {#boolean}

The Boolean field displays a toggle button to manage boolean values (e.g. Yes or No, 1 or 0, True or False).
Expand Down
27 changes: 27 additions & 0 deletions docusaurus/static/llms-code.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20373,6 +20373,33 @@ export default ({ env }) => ({



# Content-type Builder
Source: https://docs.strapi.io/cms/features/content-type-builder

## Relation
Description: Example
(Source: https://docs.strapi.io/cms/features/content-type-builder#relation)

Language: JSON
File path: Populate

```json
{
populate: {
children: {
fields: ['title', 'slug'],
populate: {
children: {
fields: ['title', 'slug'],
},
},
},
},
}
```



# Custom Fields
Source: https://docs.strapi.io/cms/features/custom-fields

Expand Down
27 changes: 27 additions & 0 deletions docusaurus/static/llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8051,6 +8051,33 @@ Relations where at least one side can reference several entries are called multi

</Tabs>

:::tip Modeling nested page hierarchies
To model a navigable tree of pages:
1. Add a `Page` collection type with a "Slug" (UID) and (optionally) an "Order" (Integer) field to control sibling ordering.
2. Create a Relation field from `Page` to `Page` and choose *Many-to-one* so each page can set its "Parent page". Strapi automatically provides the inverse "Children pages" relation.
3. When reading data, populate `children` recursively to load the tree. Keep the recursion depth small to avoid large responses.

<details>
<summary>Example</summary>
```json title="Populate nested children for a page tree"
{
populate: {
children: {
fields: ['title', 'slug'],
populate: {
children: {
fields: ['title', 'slug'],
},
},
},
},
}
```
</details>

The same populate pattern works with GraphQL or the Document Service API (see [Understanding populate guide](/cms/api/rest/guides/understanding-populate#populate-several-levels-deep-for-specific-relations)).
:::

#### <img width="28" src="/img/assets/icons/v5/ctb_boolean.svg" /> Boolean {#boolean}

The Boolean field displays a toggle button to manage boolean values (e.g. Yes or No, 1 or 0, True or False).
Expand Down