#Using DefaultValue for blocks Field: What Works?

12 messages · Page 1 of 1 (latest)

serene bayBOT
#

Hmm, I can't seem to figure out how to use DefaultValue on 'blocks' field. I want to pre-populate some of the blocks it supports and neither of these work:

blocks: [CallToAction, Content, MediaBlock, Archive, FormBlock, Banner],
defaultValue: [
        {
          name: 'Content',
          type: `CallToAction`,
        }],```

```js
blocks: [CallToAction, Content, MediaBlock, Archive, FormBlock, Banner],
defaultValue: [
        {
          CallToAction,
          Content,
        }],

blocks: [CallToAction, Content, MediaBlock, Archive, FormBlock, Banner],
defaultValue: [        
          CallToAction,
          Content,
        ],```
grim thicketBOT
#

Original message from @burnt hamlet - Moved from #general message

quasi crypt
#
blocks: [CallToAction

is config

defaultValue expects content

#

try adding content via the admin panel and then inspect the API returned value for the blocks field

#

and then copy that array into defaultValue and see if it works

#

you can probably omit the provided id

burnt hamlet
#

2_PepeThinking Ohhhhhhhhh

#

Ic Ic

#

Gonna do that

#

Thnxx