Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block schema: Incorrect description for innerBlocks example #58381

Closed
ocean90 opened this issue Jan 29, 2024 · 1 comment · Fixed by #58649
Closed

Block schema: Incorrect description for innerBlocks example #58381

ocean90 opened this issue Jan 29, 2024 · 1 comment · Fixed by #58649
Assignees
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended [Type] Developer Documentation Documentation for developers

Comments

@ocean90
Copy link
Member

ocean90 commented Jan 29, 2024

Description

The current schema description for example.innerBlocks includes [ [ 'core/heading', { content: 'This is an Example' }, [] ] ] but this format isn't supported. The correct format would be this:

innerBlocks: [
{
name: 'core/column',
innerBlocks: [
{
name: 'core/paragraph',
attributes: {
/* translators: example text. */
content: __(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.'
),
},
},
{
name: 'core/image',
attributes: {
url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg',
},
},
{
name: 'core/paragraph',
attributes: {
/* translators: example text. */
content: __(
'Suspendisse commodo neque lacus, a dictum orci interdum et.'
),
},
},
],
},
{
name: 'core/column',
innerBlocks: [
{
name: 'core/paragraph',
attributes: {
/* translators: example text. */
content: __(
'Etiam et egestas lorem. Vivamus sagittis sit amet dolor quis lobortis. Integer sed fermentum arcu, id vulputate lacus. Etiam fermentum sem eu quam hendrerit.'
),
},
},
{
name: 'core/paragraph',
attributes: {
/* translators: example text. */
content: __(
'Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.'
),
},
},
],
},
],
},

Step-by-step reproduction instructions

  1. Go to
    "innerBlocks": {
    "type": "array",
    "description": "Set the inner blocks that should be used within the block example. The blocks should be defined as a nested array like this: \n\n [ [ 'core/heading', { content: 'This is an Example' }, [] ] ]\n\n Where each block itself is an array that contains the block name, the block attributes, and the blocks inner blocks."
    }
  2. Notice the incorrect format

Screenshots, screen recording, code snippet

Bildschirmfoto 2024-01-29 um 14 19 08

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@ocean90 ocean90 added [Type] Bug An existing feature does not function as intended [Type] Developer Documentation Documentation for developers Good First Issue An issue that's suitable for someone looking to contribute for the first time labels Jan 29, 2024
@MHRSRoni
Copy link

I would like to try this.. Assign me

shreyash3087 added a commit to shreyash3087/gutenberg that referenced this issue Feb 4, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Feb 4, 2024
t-hamano added a commit that referenced this issue Feb 6, 2024
* Fix innerBlocks schema description in block.json (#58381)

* docs: Update innerBlocks description in block.json

Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>

* docs: Update innerBlocks description in block.json

---------

Unlinked contributors: shreyash3087, MHRSRoni.

Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: ocean90 <ocean90@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants