-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Post content block - layout: disable alignments #38862
Comments
The post content block is not used in the block editor, I find it difficult to visualize how this would work. If the user has content that already has full width blocks, and switches to the theme with the sidebar, or a template with the sidebar, would the alignment attributes on the inner blocks be removed too? |
I see what you mean. This is very tricky. The ideal situation would be that existing content isn't changed but in the editor you don't see wide/full align blocks at all and can't add any when on a theme with a sidebar, but the blocks remain unchanged if they already had those attributes (the reality is that full aligned blocks maintain their classes and attributes now but they just don't show as full width in the frontend, we just want to show the same in the editor). |
I've been also working on a columnised layout like the example above, and I was wondering about how we're doing with the issue like this. It'd be great if we can solve the issue like this so that designers can work on various layouts like this without hesitation. |
Maybe there could be a parameter for the theme.json customTemplates that set a unique default width of the content and then the editor could be resized depending on the template? Or actually:
I do not know how difficult that would be compared to passing the content block width from the template to the editor. |
FWIW, for whatever reason I had <!-- wp:post-content {"layout":{"type":"constrained"}} /--> This caused the content block to not have alignment controls and using the content size Removing <!-- wp:post-content /--> |
What problem does this address?
Sites that don't have a centered column with the post content have trouble with alignments. An example of this is Stewart, where the single template uses columns to achieve a sidebar and places the post content inside the right column. This invalidates alignments but the user can still set them up in the editor, which is confusing.
Frontend:
Editor:
What is your proposed solution?
This is a tricky problem to solve. The first idea that came to mind is having the possibility to disable alignments directly on the post content block, since we do want them for the templates, just not for the content of the single template. Maybe the post-content block on the page.html template can be the same layout and we do want alignments to show up for that one.
The text was updated successfully, but these errors were encountered: