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

Doc: Add documentation for ancestor property in block metadata #40027

Merged
merged 3 commits into from
Apr 13, 2022

Conversation

fabiankaegy
Copy link
Member

Adds documentation for the new API added in #39894

Adds documentation for the new API added in #39894
@fabiankaegy fabiankaegy added the [Type] Developer Documentation Documentation for developers label Apr 4, 2022
@fabiankaegy fabiankaegy self-assigned this Apr 4, 2022
{ "ancestor": [ "my-block/product" ] }
```

The `ancestor` property makes a block available inside the specified block types at any position of the ancestor block subtree. That allows, for example, to place a ‘Comment Content’ block inside a ‘Column’ block, as long as ‘Column’ is somewhere within a ‘Comment Template’ block. In comparrison to the `parent` property blocks that specify their `ancestor` can be placed anywhere in the subtree whilst blocks with a specified `parent` need to be direct children.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should double-check that, but I believe that the other difference with the parent property is that ancestor doesn't exclude other blocks from the inserter when inside the scope of the provided ancestors.

@luisherranz luisherranz requested a review from DAreRodz April 4, 2022 13:47
@gziolo gziolo added the [Feature] Block API API that allows to express the block paradigm. label Apr 4, 2022
@gziolo gziolo changed the title Add documentation for ancestor property Doc: Add documentation for ancestor property in block metadata Apr 4, 2022
@gziolo gziolo added the Needs Dev Note Requires a developer note for a major WordPress release cycle label Apr 4, 2022
@gziolo
Copy link
Member

gziolo commented Apr 4, 2022

@bph - this new API will require a dev note.

@luisherranz
Copy link
Member

I've noticed this section about parent in the inner blocks tutorial, and I've added a reference to ancestors as well in 0921a49.

@gziolo
Copy link
Member

gziolo commented Apr 13, 2022

Is there anything missing here? Can we land this PR?

@fabiankaegy fabiankaegy merged commit 409eefc into trunk Apr 13, 2022
@fabiankaegy fabiankaegy deleted the documentation/add-docs-for-ancestor-property branch April 13, 2022 08:45
@github-actions github-actions bot added this to the Gutenberg 13.1 milestone Apr 13, 2022
@bph
Copy link
Contributor

bph commented Apr 19, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. Needs Dev Note Requires a developer note for a major WordPress release cycle [Type] Developer Documentation Documentation for developers
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants