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

Update core/image block to use align supports #13780

Closed
ryanboswell opened this issue Feb 8, 2019 · 5 comments
Closed

Update core/image block to use align supports #13780

ryanboswell opened this issue Feb 8, 2019 · 5 comments
Labels
[Block] Image Affects the Image Block [Feature] Media Anything that impacts the experience of managing media [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later [Type] Enhancement A suggestion for improvement.

Comments

@ryanboswell
Copy link

Is your feature request related to a problem? Please describe.
Several core blocks now use the align supports approach to block alignments (center, wide, full, etc..), allowing consistent controls and filtering of what alignments are allowed (or if they're allowed at all). But in adjusting these on a site I found that the core/image block still includes the BlockAlignmentToolbar itself, with a hard-coded array of alignments that make it impossible to filter externally. Trying to set the align supports value results in two BlockAlignmentToolbars being added to the block (the smaller group is the custom set I provided, removing left and right options):

duplicate-alignments

Describe the solution you'd like
Ideally the core/image block uses the alignment hooks approach implemented across other blocks like core/cover, core/table, etc.. so developers (plugin/theme/etc..) can modify them as needed, in a manner consistent with other blocks.

Describe alternatives you've considered
There really aren't many alternatives, since the hooks approach has already been implemented across many other blocks as a standard approach, and currently there isn't another way to change Image alignment options without monkey-patching Gutenberg or a rather complex series of BlockEdit filters (in theory, not sure that would even work).

@youknowriad youknowriad added [Type] Enhancement A suggestion for improvement. [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later [Feature] Media Anything that impacts the experience of managing media [Block] Image Affects the Image Block labels Feb 8, 2019
@mcguffin
Copy link

mcguffin commented Feb 9, 2019

As a supplement: core/cover behaves just like image blocks, when trying to modify the align support.
Related: https://wordpress.stackexchange.com/questions/317113/how-to-disable-align-wide-for-specified-blocks-in-gutenberg/326667#326667

@jwktje
Copy link

jwktje commented May 16, 2019

Any update on this? Having the same issue.

@christophhapple
Copy link

Same here ... still no update?

@jwktje
Copy link

jwktje commented Sep 4, 2019

@christophhapple I have had no luck since I last tried either.

@youknowriad
Copy link
Contributor

Right now this is not possible with the way alignments work in the image block but we're considering making the alignments more consistent and easier to support with #20650

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block [Feature] Media Anything that impacts the experience of managing media [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants