Skip to content

Commit

Permalink
Object Summary (#2252)
Browse files Browse the repository at this point in the history
* TinaCMS content update

* TinaCMS content update

* TinaCMS content update

* TinaCMS content update

* TinaCMS content update

* TinaCMS content update

* TinaCMS content update

* TinaCMS content update

* Update astro.json

* Update object.mdx

---------

Co-authored-by: tina-cloud-app[bot] <58178390+tina-cloud-app[bot]@users.noreply.github.com>
Co-authored-by: Isaac Lombard [SSW] <152236421+isaaclombardssw@users.noreply.github.com>
  • Loading branch information
tina-cloud-app[bot] and isaaclombardssw authored Sep 27, 2024
1 parent eff4e5c commit b498473
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions content/docs/reference/types/object.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
---
title: The "object" field
last_edited: '2024-09-12T01:50:34.111Z'
last_edited: '2024-09-26T06:54:19.563Z'
next: content/docs/reference/types/rich-text.mdx
previous: content/docs/reference/types/reference.mdx
---

## `object` Type

The `object` field is a dynamic field type that creates a nested page in the CMS with the data it contains.

This can be used to create repeated data structures, group related data in the CMS and/or give users the option to choose between a set of templates.

```ts
type ObjectField = {
label: string
Expand Down Expand Up @@ -35,6 +39,22 @@ type ObjectField = {
}
```
## Usage
Ultimately there are 3 ways to configure this type...
* With `list` set to `false`, the `fields` array can be used to wrap some data – this appears in the editor as a nested page. This can be used to organise the CMS, such as grouping options together, as in the gif below.
![](https://res.cloudinary.com/forestry-demo/image/upload/v1727331124/tina-io/docs/Sep-26-2024_16-05-37_d2ol8w.gif)
* With `list` set to `true`, the `fields` array contains the data structure to be repeated – this appears in the editor as above, but grouped as a list.
![](https://res.cloudinary.com/forestry-demo/image/upload/v1727331115/tina-io/docs/Sep-26-2024_16-03-00_f3ogev.gif)
* With `list` set to `true`, and using `templates` as opposed to `fields` the user can select between associated templates – this appears as above, but pressing the `+` gives you the option to choose between templates.
![](https://res.cloudinary.com/forestry-demo/image/upload/v1727331134/tina-io/docs/Sep-26-2024_16-07-02_zv5uth.gif)
## Examples
Tina will generate the appropriate component depending on the configuration provided.
Expand Down Expand Up @@ -108,9 +128,7 @@ Tina will generate the appropriate component depending on the configuration prov
### Using list object as a wrapper for other types
Number, boolean, datetime and rich-text field types can be used in this way to add list options to the TinaCMS editor.
Reference field types can be used in this way to create a list of references.
Number, boolean, datetime, reference and rich-text field types can be used as the sole field of an object to create a list of one of those types.
```javascript
{
Expand Down

0 comments on commit b498473

Please sign in to comment.