New answers tagged

0 votes

Image styles - How to resize uploaded images and force an aspect ratio

If you want to resize the image while maintaining the desired aspect ratio, this is actually two steps. Get the image in the appropriate aspect ratio. Resize the image. One way to do this is with ...
user avatar
1 vote
Accepted

How to display in a block the media used in a node?

Media images that are embedded with CKEditor into a text field are referenced using <drupal-media> tags. These tags are parsed by an input filter when the node is rendered. So, as far as I ...
user avatar
1 vote
Accepted

Broken Image styles don't generate

I was using the "convert" effect on all image styles on my website which has an issue in Drupal 9. This patch fixed the issue for me.
user avatar
1 vote
Accepted

Generate a Media entity from a remote URL?

If it supports oEmbed you can use OEmbed Source plugin similar to below. https://git.drupalcode.org/sandbox/Bhanu951-3225164/-/blob/1.x/src/Plugin/media/Source/TikTok.php If it doesn't support oEmbed ...
user avatar
0 votes
Accepted

How do I apply the `loading="lazy"` attribute to responsive media?

This is an active area a research and development in Drupal Core. Although there is no quick fix, this issue is the locus of work. Test the patches and provide feedback.
user avatar
  • 2,760
2 votes

Link in URL field to Media File

I think that the issue is that public:// is a PHP file stream wrapper defined by Drupal, which is a PHP language feature, and is not a URL, which is a publicly defined standard. The field is ...
user avatar
  • 870
1 vote

Media Library results filtered by user

That should be quite straightforward to set up: Add a contextual filter to the View which powers the Entity Browser Choose "Authored by" as the field Under When the filter value is not ...
user avatar
  • 163k
0 votes

Get Video URL from Media Entity reference field

To display the raw url of a remote video field in twig (Drupal 9): {{ node.field_media.entity.field_media_oembed_video.0.value }}
user avatar

Top 50 recent answers are included