New to Layout Builder, but been working with Drupal for about 10 years.

I'm looking for a way to embed media inside a Layout builder page, where the text wraps around the media block. I cursory glace at modules and configuration doesn't seem to indicate the best way to do this.

Ideally I want something that's easiest on the user, without having to add custom CSS classes to every embedded media.

I can think of a couple ways of accomplishing this, but am not sure what best practices are:

1) Add the media as a field to the custom text+media block, that behaves like a single visual paragraph. Use CSS to render the media (or field group, if there's a caption) either as a floating div for widescreen) or as a full width block (for mobile) depending on the screen width.

2) Add the media as its own block in a custom section layout. Instead of a 75%/25% two column, it would be "75%/25% float right" - with the entire right column being floated right or displayed first depending on the screen width.

Are there any contrib modules that already accomplish this?

Is there configuration setup I'm missing that already accomplishes this?

Thanks in advance!

Comments

TrevorBradley created an issue. See original summary.

larowlan’s picture

Add a media view mode for floating and use the media library integration with a block type that has a single WYSIWYG field?

IE embed the media entity in a 'body' field where there is a view mode that sets the image up to wrap

All doable with just Drupal core

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.1.10 (June 4, 2021) and Drupal 9.2.10 (November 24, 2021) were the last bugfix releases of those minor version series. Drupal 9 bug reports should be targeted for the 9.3.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

cilefen’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.