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

Nested Blocks: Inner block arrangement options #5448

Closed
aduth opened this issue Mar 6, 2018 · 5 comments
Closed

Nested Blocks: Inner block arrangement options #5448

aduth opened this issue Mar 6, 2018 · 5 comments
Labels
[Feature] Block API API that allows to express the block paradigm.

Comments

@aduth
Copy link
Member

aduth commented Mar 6, 2018

Previously: #2995 (#2995 (comment)), #3745 (#3745 (comment))

The InnerBlocks component, used for block nesting, should allow a block implementer to assign a predefined block arrangement, optionally locking or otherwise restricting the types of blocks which are available for insertion in the block.

This could potentially align with existing block templating

Pseudo-code examples:

<InnerBlocks
	allowedBlockNames={ [ 'core/image', 'core/paragraph' ] }
	template={ [
		createBlock( 'core/image' ),
		createBlock( 'core/paragraph' ),
	] }
/>

For the inverse relationship (blocks restricted to certain parent contexts), we could either...

  • Rely on a combination of block's isPrivate API (already used to omit block from inserter) and treat allowedBlockNames as overriding this preference
  • Add a property to the block API, allowedRootBlockNames: [ ... ]

Related Work:

Discussion by @jorgefilipecosta about defining inner blocks supported:

https://wordpress.slack.com/archives/C02QB2JS7/p1520252046000229

cc @jorgefilipecosta

@robbisy
Copy link

robbisy commented May 13, 2018

The InnerBlocks component link are broken :

@aduth
Copy link
Member Author

aduth commented May 14, 2018

@robbisy The component has been moved to the editor directory. Here's the updated link:

https://github.com/WordPress/gutenberg/tree/master/editor/components/inner-blocks

(I've revised the original comment as well)

@ajitbohra
Copy link
Member

Closing this as Nested / Inner blocks have been updated https://github.com/WordPress/gutenberg/tree/master/editor/components/inner-blocks

cc: @aduth

@jessicaplant
Copy link

Link is broken again :(

@aduth
Copy link
Member Author

aduth commented Sep 18, 2018

@jessicaplant Here's the updated link. I expect this one should remain relatively stable (famous last words):

https://github.com/WordPress/gutenberg/tree/master/packages/editor/src/components/inner-blocks

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.
Projects
None yet
Development

No branches or pull requests

4 participants