Questions tagged [media]

Drupal core has some modules to handle media files, such as the Image module (Drupal 7) and the Media module (Drupal 8).

Filter by
Sorted by
Tagged with
0
votes
2answers
19 views

How do I load a Media entity from a File entity?

I have a File entity loaded programmatically. I want to load a Media entity from it. Is there a way to achieve this?
0
votes
0answers
9 views

Vimeo embed code being ignored

Feeling frustrated. I run an number of websites, and have recently had need to embed video (mostly Vimeo but not exclusively) in one of them. I have another site where I have embedded the code ...
0
votes
0answers
22 views

Is there a way to use the core Media module with an existing image field?

I have a site with a lot of nodes already using an image type field where I'd like to switch to using a Media browser (for consistency with other areas of the site). It seems a media browser can only ...
0
votes
0answers
17 views

How to upload image to media library? (No upload field)

I'm missing something in media_library. When I click "Add media" in the media library (/media/add/image) there's no browse/upload field. All of the other media types have an upload field. This ...
-6
votes
0answers
22 views

Blurry pictures with text [closed]

I need to upload a lot of pictures with text, made in illustrator and Photo shop. However, the text and graphs looks very blurry on the published website. I have exported them to .jpg, and i cannot ...
0
votes
0answers
17 views

How can I populate and entity reference field/videos that have been previously migrated to the media library?

Upgrading from D7 to D8, we previously migrated D7 youtube and vimeo videos to the Drupal 8.8 core media library. We now are attempting to migrate the Video nodes and their media library video fields ...
0
votes
1answer
11 views

Unable to add images to content “Image field is required”

Developing a new site with Drupal 8, I was attempting to add an image to a custom block. In the editor I clicked the image icon and got a dialog to upload an image. After specifying a file (making ...
0
votes
1answer
38 views

Images with applied styles are not being displayed

I have checked every single solution on the internet with no avail. On the same server and using the same Drupal version 8.8.4, I have two completely separated sites. Site A is working as expected ...
0
votes
0answers
14 views

Possible to set image style based on aspect ratio instead of px dimensions?

I'd like to create an image style that uses an aspect ratio, so that images maintain their general dimensions but get cropped based on that ratio. Essentially this would mean that a 16:9 image style ...
1
vote
0answers
22 views

Media Library uploaded images don't get the derivatives generated with the Image Style Warmer module

I am using Drupal's Image Style Warmer module to generate derivatives for images uploaded to Drupal. But it is only working if the images are uploaded through "Content->Media" tab. I was trying on my ...
2
votes
1answer
28 views

Missing tabs in Media Library widget in Drupal 8.8

I'm trying to set up Media Library widget in Drupal 8.8. But for some reason, no tabs are available for selection in the widget settings. Please see following screenshots: Do I need to install some ...
0
votes
0answers
11 views

How to get an generic image icon for image field type (like Generic File formatter for file field)

I have media field on a paragraph entity. This field can hold media types, files, image etc. Looking at admin/structure/media/manage/file/display there is a generic file formatter. However, for image ...
0
votes
0answers
8 views

Image inserted into Ckeditor via Media widget exists when viewing config storage in custom form but not outside of custom form. Example below

I have a custom form like: public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->config(static::SETTINGS); // dpm(check_markup($config->get('...
0
votes
1answer
108 views

How can I reference previously imported media entities?

I have been trying to attach media entities to node entities in Drupal 8 with a custom migration but despite numerous attempts and countless hours reviewing forums i'm stumped - I'm desperately hoping ...
0
votes
1answer
26 views

I am getting a PDO error which seems related to the Media module

After Drupal 8.8 upgrade media module is not working. In admin media links are not working e.g /admin/content/media Error : The website encountered an unexpected error. Please try again later. ...
1
vote
1answer
83 views

How can you display document file sizes next to a media link button?

I'm trying to display the file size of a file next to a media link button on a page. I have two content types with a media entity reference field in each. Each field is restricted to only pull from a ...
0
votes
0answers
26 views

How can I set Focal Point coordinates in a View or Twig?

I use the Focal Point module in D8, and I'm trying to figure out how I can access the X and Y coordinates of the focal point through Twig in either a view or Twig template so I can use them as ...
1
vote
1answer
43 views

Render media url in node--page.html.twig

I have an Entity reference field field_video. It's a core Media field with a Reference type of Remote video. Because I use this field_video in my Hero section I need some additional markup here. ...
1
vote
1answer
91 views

Align embedded Media Images

When I embed an image into CKEditor text I can choose alignment options. When I embed a Media Image I cannot choose alignment, but a Media View. A media View allows me to specify image size (via image ...
0
votes
1answer
11 views

Media Title appearing in View when HTML is stripped

I've run into an issue with media in a view. I have a view using bootstrap grid to display body field content. The view field content being displayed is setup to strip out HTML, but the word "Image" ...
0
votes
0answers
49 views

Autoplay embed video added from core Media module

Is it possible to, somehow, enable embed video autoplay for a field added form Media module? For example media type "Video" has this option, but type "Remote video" doesn't. Embed video field is ...
0
votes
0answers
30 views

Hook or event when Media file is inserted/updated/deleted but only when node form submitted

I created a field of type "Entity reference" and referencing an item of type Media. In other words its an image field. I would like to execute code with an hook or an event when an image is added, ...
0
votes
0answers
46 views

When I try to load an media entity with $mid and entityTypeManager->getStorage get nothing

I'm trying to generate a field formatter, and I get this error: Error: Call to a member function getStorage() on null en Drupal\svg_url\Plugin\Field\FieldFormatter\Url4SvgFieldFormatter->...
0
votes
1answer
50 views

Create media from blob

I am receiving a payload with blob files. I would like to store them as files and create a media entity. Here's the code I have to create the Media object if (!empty($payload['blobFile'])) { $...
0
votes
2answers
65 views

How to use media field with entity browser widget in a frontend theme?

I have created a media field in my content type. In the manage form display, I have selected entity browser as display instead of media library. When I open the node form as admin in an admin theme ...
0
votes
0answers
14 views

How to get the node title which is related to file in File usage view?

I am just trying to list out the nodes which are linked to files in the File Usage view. That will show up in this URL: /admin/structure/views/view/files/edit/page_2. In this view I tried to add ...
2
votes
1answer
31 views

How to get the media that owns a file?

I have a file and I know there is a media that references it. How can I get this media? In the opposite direction, knowing the media id, I can get the file: $media = Media::load($mid); $fid = $media-...
1
vote
0answers
67 views

Entity browser or Media Library for PDF uploads?

Client has a custom Content Type for for downloadable PDF document detail pages, which contains an entity reference to the File media type. They want Full and Teaser view modes to display a thumbnail ...
0
votes
1answer
30 views

Load Media File in Webform Mail Handler

I want to use a single webform to send download links with specific media files to visitors that fill out that form. For example on an URL like this: https://example.com/downloads?media=1234 The ...
0
votes
0answers
21 views

Add the presentation role to an image

I have an events page and I don't want screen readers to pay attention to the image links as each event already has a link associated with it. Having 2 links read out seems like overkill. In my ...
0
votes
0answers
23 views

Media field image preview back instead of close

Drupal 8.x using: Media library & Focal Point module. I have a node type with a media field. When you upload an image in this field you can set the image information (functionality of the media ...
0
votes
0answers
18 views

How to choose content field shown in View using URL parameter?

I have contentType Screenshot which has 6 Image fields shot1..6. Then I have a view screenshots_1 which shows shot1 in a grid. I need to have 6 paths, e.g. /screenshot_1..6 each pointing to same view ...
1
vote
0answers
18 views

How to add an alias filter to the media view?

I have a path alias for my media content provided by pathauto. The media view at 'admin/content/media' shows all the content. I am able to add filter for the media entity name, type, language and ...
0
votes
1answer
16 views

Image Upload Issues Same Image Different File Name Always Receive This Error

We are currently working on fine tuning and updating the dev backend of our CMS we're rolling out for a new site. I was familiarizing myself with the new system and uploaded some images in error. I ...
0
votes
0answers
11 views

Storage API + Services 3: How to work together?

I am trying to set up a site that will be storing a large amount of images. I am using Storage API module for that and It is working fine through web. Now I need a REST Service to upload images. I am ...
0
votes
0answers
39 views

Problem with inline images after migration

We recently migrated from D7 to D8 (8.7.6). The migration went OK with the exception of nodes with inline images in the body fields (see the attached screen shot). The images were created in D7 with ...
0
votes
1answer
43 views

Image Style Clarification

Can I get some clarification as to why images aren't being generated for a certain image style in a view? Here's my setup; I have an Article content type which allows for a main image to be uploaded. ...
0
votes
0answers
13 views

Media field format 'rendered entity' for video and 'thumbnail' for image (with image style)

I have a custom block type (call to action) where the editor can insert an image or video. In the 'manage display' of the field_media I can set the format to Rendered entity. Both the image or video ...
0
votes
0answers
27 views

YouTube media remote video - thumbnails in wrong aspect ratio have letterbox/black bars [duplicate]

I'm using the media module in D8 (core 8.7.7) I can add YouTube videos, however although the videos themselves (and the thumbnails on youtube.com) are widescreen, Drupal is saving 480x360 4:3 images ...
0
votes
0answers
59 views

Unable to alter OEmbed remote video providers

I'm trying to add a remote video provider for OEmbed. I'm using the hook_media_source_info_alter to change the OEmbedDeriver class like this: use .../CustomOEmbedDeriver; /** * Implements ...
0
votes
1answer
274 views

Custom remote video thumbnail

I'm using the media entity from Drupal core together with the media library, to handle media on my site. I have Remote Video and Image with crop media types. I'm using the crop and image_widget_crop ...
0
votes
0answers
27 views

Can't edit media Image from within node edit

I'm using Media and the Media Library (yes I know this is experimental). And all of the sudden I'm not able to edit my added image when I'm editing a node. In an earlier stage of the website I was ...
0
votes
1answer
28 views

Entity:media doesn't exist error when searching for url in “add link” in wysiwyg

When adding a link into a rich text field (wysiwyg) (see images bellow) and searching for a keyword the throbber icon keeps spinning and that's it. I looked at the error logs and found the following, ...
3
votes
2answers
589 views

How can I render a responsive image style from an image in the theme directory?

I am working on template views-view-fields--myview.html.twig. But I do not think it matters what template you are working with for this to work. I found this Twig that can add Drupal responsive ...
0
votes
0answers
16 views

Media field permissions

I have a certain use case. I have an entity that has a "media" reference field. I want users to be able to add/edit/delete media entities without giving them Edit any media or Delete any media ...
0
votes
1answer
62 views

How can I load all Media of a certain type?

I am trying to load all media items of a certain type but I can't find how to. Is there a way to set a filtering type on something like $media = Media::loadMultiple(); Or do you have to load all ...
0
votes
1answer
65 views

How can I programmatically create a media object and a new file and associate the file with the media object?

I am trying to programmatically create a media object and a file, and then associate the file with the media object. The first part works--I can successfully create the media object and file. But ...
0
votes
0answers
43 views

Programmatically update remote video thumbnail

Scenario: YouTube video was previously unlisted, so thumbnail not retrieved and now needs to be, or chosen thumbnail has been changed and needs updating. There are a couple of core issues open on ...
1
vote
0answers
34 views

Define a default image when using image as base field in custom entity

I defined a custom entity type with an image base field. Now I want to have a default image which seems to be quite tricky: when I define a default image on a field api field and export the configs I ...
0
votes
0answers
30 views

CKEditor/Media Gallery Using Absolute URL for images, how to update?

After entering 100's of hours worth of content we noticed that the images entered through the media gallery plugin contain absolute paths, not relative. This means they breaking when we switch domains....

1
2 3 4 5
53