gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Add vertical alignment to Media & Text block

Open melchoyce opened this issue 7 years ago • 33 comments

image

I've been wanting a "Card" block for a while, which would allow for easy grouping of media, headings, and text, with an optional background color... and while I think that would still be valuable, if only for the styles we could provide (borders, drop shadows, etc.) adding a vertical option to the Media & Text block would go a long way.

melchoyce avatar Jul 21 '19 18:07 melchoyce

Hey Mel

Is this something similar to? "Full Screen alignment/display option on several blocks" https://github.com/WordPress/gutenberg/issues/16385 / https://github.com/WordPress/gutenberg/pull/16738

paaljoachim avatar Jul 28 '19 00:07 paaljoachim

I don't think so.

melchoyce avatar Jul 29 '19 14:07 melchoyce

Is this something similar to? "Full Screen alignment/display option on several blocks"

I also don't think it is related.

I like this suggested feature. I see a bit problematic that we already have a "vertical alignment" in Media & Text - it just means something completely different that what you mean 😀

Screenshot 2019-07-31 at 16 54 53

We would need to come up with a different name here. We also have the hidden "Stack on mobile" feature which already does this a bit, just under very specific circumstances.

marekhrabe avatar Aug 01 '19 00:08 marekhrabe

I do think this would be beneficial, and could also be offered as a block pattern to offer in the placeholder state. As @marekhrabe points out, vertical alignment and the stack on mobile controls would probably need to be conditionally available only when the left/right variations are available.

Part of me does wonder if these new options should actually be a different option though — a more straightforward "Card" block.

kjellr avatar Aug 12 '19 17:08 kjellr

If we do want to go in that direction, I can make a new issue with my existing Card block mockups.

melchoyce avatar Aug 12 '19 19:08 melchoyce

I think Card sounds like a nice block to have. Especially excited about themes being able to style it as it is such a common design pattern these days.

Considering it has such close similarities to Media & Text, we can probably make very seamless block transforms between those M&T and Card.

marekhrabe avatar Aug 13 '19 16:08 marekhrabe

I've recently added this feature on EditorsKit Plugin : https://wordpress.org/plugins/block-options/ . Here's my implementation so far. I've added new Toolbar besides the existing layout option. Works really well on core Gutenberg version and Gutenberg plugin 💯

Screen Capture on 2019-09-19 at 15-33-24

phpbits avatar Sep 24 '19 17:09 phpbits

Hello everyone.

@retrofox Damien is working on this PR: Full Height Alignment Toolbar: Init - Add to Media&Text and Cover https://github.com/WordPress/gutenberg/pull/26615 It is associated with this issue.

paaljoachim avatar Nov 03 '20 17:11 paaljoachim

I would appreciate ability to align the text to the top. At the moment it is always central compared to the image. In my case the image is on the left and the text on the right. It would be nice to optionally choose the placement of all text to top, middle or bottom of the space.

ajtruckle avatar Mar 15 '21 15:03 ajtruckle

Anybody who wants to create a media-text block style for an easy card effect use this sass:

.wp-block-media-text {

	// Block Card Style
	&.is-style-card {

		// Permanently stacked
		grid-template-columns: 100% !important;

		.wp-block-media-text__media {
			// Permanently stacked
			grid-column: 1;
			grid-row: 1;
		}

		.wp-block-media-text__content {
			// Permanently stacked
			grid-column: 1;
			grid-row: 2;
		}

	}
}

poof86 avatar Mar 09 '23 16:03 poof86

Is this still needed, or is the stack group block variation enough?

carolinan avatar Jun 16 '23 09:06 carolinan

I am merely putting my suggestions format for the text /media block and options for text alignment. I don't use it now because of this. I use 2 column block and drop in the image on left or right and text on other side.

ajtruckle avatar Jun 16 '23 11:06 ajtruckle

I believe it would still be helpful to add in the vertical alignment to the Media & Text block as it gives additional options for people who do use the block. Having multiple ways to reach an end result is very helpful.

paaljoachim avatar Jun 20 '23 06:06 paaljoachim

+1 for vertical stacking, both top and bottom orientations. Clients have a much easier time updating Media & Text blocks than drilling through nested grouped blocks.

spacedragn avatar Sep 05 '23 21:09 spacedragn

Is it now possible to stack vertically and horizontally? I think it would be a great and super easy feature!

fabianwohlfart avatar Jan 19 '24 08:01 fabianwohlfart

I would also like this feature!

mot-K avatar Nov 20 '24 20:11 mot-K

This is an old and an interesting issue! @t-hamano @Mamaduka @jameskoster @retrofox Any thoughts?

paaljoachim avatar Nov 20 '24 23:11 paaljoachim

My (likely controversial) thought is that Media & Text is a bit outdated, and that the use case would probably be better served by a Pattern.

jameskoster avatar Nov 21 '24 16:11 jameskoster

I think we can close this. The exact layout can be achieved with the Group blocks and saved as a pattern.

The Media & Text predate many new tools for block layouts and reusability, which was the main reason for introducing it. I think @jasmussen might remember more background details about it.

Mamaduka avatar Nov 21 '24 16:11 Mamaduka

I do not use patterns anywhere on my website. My request was simple - ability to align all content on the right to top / middle / bottom independent of the image on the left.


From: James Koster @.> Sent: 21 November 2024 16:17 To: WordPress/gutenberg @.> Cc: ajtruckle @.>; Comment @.> Subject: Re: [WordPress/gutenberg] Add vertical alignment to Media & Text block (#16698)

My (likely controversial) thought is that Media & Text is a bit outdated, and that the use case would probably be better served by a Pattern.

— Reply to this email directly, view it on GitHubhttps://github.com/WordPress/gutenberg/issues/16698#issuecomment-2491680087, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB45RM2CNI3WGGD6UQKYWMT2BYBRJAVCNFSM6AAAAABSFOAHNSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJRGY4DAMBYG4. You are receiving this because you commented.Message ID: @.***>

ajtruckle avatar Nov 21 '24 16:11 ajtruckle