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

Introduce a blacklist/whitelist for which blocks can be inserted into a column width #4904

Closed
paulwilde opened this issue Feb 6, 2018 · 3 comments
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience Needs Decision Needs a decision to be actionable or relevant [Type] Enhancement A suggestion for improvement.

Comments

@paulwilde
Copy link
Contributor

paulwilde commented Feb 6, 2018

With the introduction of nested blocks (#3745) one concern is that certain blocks might not be designed to work with certain column widths. An example would be that the Cover Image block is mainly designed as a full width block, but not to go inside a 1/6 column.

Allowing any block to go into any particular column width adds an additional burden on developers to ensure their block works correctly with all column widths, which in some cases is impossible. It adds control to ensure the client of a website you've developed for doesn't try and fit a square peg into a round hole.

One idea of implementation would be to introduce a new block configuration key maybe something like columns where if not defined, it's assumed the block works in any column width. Setting a value of [1, 2] would mean the block can be placed in either a 1/1 or 1/2 column, but not a 3-6 width column.

When you open up the block selector to add blocks to a column, either blocks which aren't compatible with that column width should either be greyed out or not shown at all. Not showing them at all probably the better solution.

@jeffpaul jeffpaul added the [Type] Enhancement A suggestion for improvement. label Mar 8, 2018
@westonruter
Copy link
Member

I think this is would be an application of child blocks: #5540

@jasonbahl
Copy link

Also related to this closed issue: #1654

@designsimply designsimply added [Feature] Extensibility The ability to extend blocks or the editing experience Needs Decision Needs a decision to be actionable or relevant labels Aug 17, 2018
@mtias
Copy link
Member

mtias commented Oct 7, 2018

InnerBlocks allows specifying which blocks are allowed. A generic mechanism for opting in to columns doesn't make a lot of sense to me because the column container itself can be at different widths or values.

What makes more sense down the road is for InnerBlocks to define which "block width" alignments should be available within it.

@mtias mtias closed this as completed Oct 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience Needs Decision Needs a decision to be actionable or relevant [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

6 participants