Questions tagged [media]
Drupal core has some modules to handle images and other media files, for example the Image module and the Media module.
2,771
questions
0
votes
0
answers
6
views
Views relationship with heirarchical terms
Resources (media) -> Tags (taxonomy term) <- Assignments (paragraph)
On one side, I have a Paragraph that's assigned taxonomy terms. On the other side, I have Media assigned the same taxonomy ...
0
votes
0
answers
25
views
Insert Media button in Ckeditor 5 not load with non admin user
I use Drupal 9.5.5, CKeditor 5 and BootstrapBarrio theme, but I have also used Claro theme.
I have disabled "Aggregate JavaScript files" and "Aggregate CSS files" option in ...
0
votes
1
answer
22
views
Form field states with media fields that use media library widget and conditionally displaying visibility based on other media fields
I am trying to get some media fields to hide/show conditionally using $form fields #states API, based on other media fields (all the media fields are using the "Media Library" widget in form ...
0
votes
0
answers
12
views
How to set media field mappings to autofill the target fields when uploading the file instead of saving to those files when saving the media entity
I am using the document media type for pdfs. I am also utilizing the field mappings for:
Name
MIME Type
File size
and I will be adding a field mapping for the pdfs subject as well using a Media ...
0
votes
0
answers
21
views
Can I change the autocomplete to a dropdown for the entity_browser module?
I'd like to be able to change the autocomplete for the Site Sections portion of the entity_browser module.
I'm not seeing any way to modify this within the admin. Am I missing something? Can I do this ...
-1
votes
0
answers
44
views
media embed button missing in ckeditor5
The media embed button is missing in drupal10 with ckeditor5.
https://ckeditor.com/docs/ckeditor5/latest/features/media-embed.html
Is it a misconfiguration ?
or is it yet not available ?
will it be ...
-1
votes
0
answers
28
views
Is Media Gallery 7.x-1.4 compatible with Media 7.x-2.30, and can I change to that version, and if so how? [closed]
I've got a Drupal 7 site with Media 7.x-2.30 and Media Gallery 7.x-2.x-dev. At the time this site was created, Media Gallery 7.x-2.x-dev was required for Media 2.x.
The site contains lots of galleries ...
0
votes
0
answers
16
views
Custom Media type token for specific field
I have a custom Media type - gallery_image and it has a couple of extra fields, including field_caption. (Drupal 9)
Do replacement tokens for custom Media type fields get generated automatically, or ...
0
votes
1
answer
24
views
Double click action in CKEditor 4? [closed]
I have D9.5 site with CKEditor 4 and media library module.
In CKEditor, when I double click on some existing media I get popup to select new media to replace clicked one. After selecting new visually ...
2
votes
0
answers
50
views
How to duplicate/clone a field in a content type
I have a custom content type with an image field. I want to convert this image field into media type. There are already thousands of nodes created with this content type.
One of the ways I've ...
1
vote
1
answer
42
views
Are media entity Ajax calls cached?
In my Drupal 9 site with CKEditor 4 and I have created "media gallery" media type, which displays set of images (using slideshow module). So, when I click "insert media" CKEditor ...
1
vote
1
answer
48
views
How can I modify/edit/change the media video controls?
I was wondering how could I modify the controls from a media video.
In my particular case, I want to remove the "Download" button from the controls, see:
2
votes
1
answer
197
views
Why does “ Nesting level too deep - recursive dependency?” occur in a compiled template?
After upgrading from 9.4.8 to 9.5.3 a problem came up (see below) so when I add more than one image in articles media field node-image, I get a 500 error.
PHP Fatal error: Nesting level too deep - ...
1
vote
0
answers
26
views
Migrate Medias update : entity_lookup process error
I'm trying to update Medias already existing in my Drupal using Migrate and the process entity_lookup.
The field field_uuid was designed specifically as a matcher for my .json original datas and the ...
0
votes
1
answer
102
views
How to change media image private to media image public, just for a specific filemime, and update the url?
Using Drupal 9.4. The Media File system is set to Private
The Drupal default media type Image is set to private. It now contains hundreds of images. We want to switch only this media type from private ...
2
votes
0
answers
148
views
Allow users to upload heic images and auto-convert to jpg
It seems that heic images are increasingly popular way to store images (the default image format since ios 11, but browsers do not support them. Site visitors may attempt to upload an heic image from ...
0
votes
0
answers
58
views
How can I print the link to the media file?
I have an image media type. I would like to display the image and the link to the file in the rendered Media. I don't want the image to be a link to the file.
I couldn't find a link to the file field ...
0
votes
0
answers
52
views
How configure webp with image optimize?
I'm on D9.4.x using ddev as local server.
The site have already configured Image optimize and Image magick
There's a image optimize pipeline that is the default for all the image styles.
Now, I've ...
1
vote
1
answer
35
views
Storing PDF Subject Data in Media Entities
I have pdf documents that I need to create as entities on our website. The pdfs were created with metadata, such as title and subject, that we want to have available in Drupal.
I am trying to save the ...
0
votes
0
answers
35
views
Can you add background-position selector to masthead images?
The theme we are using incorporates mastheads on almost all pages. The images are 1440x625 with a hard coded background-position of top center. I had no hand in developing this theme so I'm really ...
0
votes
2
answers
337
views
How to display Media image with alt attribute in paragraph twig template
I'm trying to access alt attribute as in given example Get Media Image URL in Paragraphs Twig Template - Drupal 8
But there is an example how to access alt and title...
That's easy, too. You should ...
0
votes
1
answer
49
views
How do I retrieve the tokenised path for the Files Directory setting configured via the fields settings? [closed]
I'm using this code to retrieve a remote file, during the process of creating a new a media entity.
$url = 'https://example.com/example.jpg';
$image = system_retrieve_file($url, NULL, TRUE);
$...
0
votes
0
answers
99
views
How to set the default value for media entity in content type in a user friedly way?
In a new content type (Drupal 9) I have an Entity Reference field for Media (Image). I already chose and saved a default media entity in the field settings.
Unfortunately when creating a new node of ...
0
votes
0
answers
29
views
I am having trouble uploading an image in Gutenberg, can I upload it otherwise to the media library?
I am having trouble uploading an image in Gutenberg (there is "infinite loading", without error, when I try to upload and eventually no image gets uploaded to the media library).
Can I ...
0
votes
0
answers
28
views
How to prevent numbering (_0, _1) of file uploads? [duplicate]
Is there a way in Drupal 7 to prevent numbering (_0, _1) of file uploads with the same name?
How to tell Drupal to replace the previous file?
Maybe there is already a ready-made module?
Or does anyone ...
0
votes
0
answers
22
views
How to Get Imported Files to Appear in Media Library
I'm looking for a way to get images added via a feed to appear in the media library. I see them from the 'Files' tab under 'Content', and I also see them in the 'file_managed' table.
Surely there's a ...
0
votes
0
answers
56
views
Unable to upload local video with CKEditor
I am unable to upload a local video file using the CKEditor's Insert Drupal Media icon on Drupal9.4.4. The video is not activated even though the tag has been loaded in the text file's source code as:...
0
votes
1
answer
62
views
Is there a way to add external links to images uploaded in media browser?
A customer of mine, when they upload an image through the media browser, want to add an external URL to it. I tried adding the URL to the image field in the image type of media browser but I am not ...
0
votes
0
answers
143
views
Media Library and paragraphs not working
I have a paragraph with multiple fields, one of them is a media field (document type).
If I add a new paragraph and then add media I got "ajax error".
If I add new paragraph and save content ...
0
votes
0
answers
15
views
Hot do I add a custom property to video_embed_field?
I decided to add a new property to video_embed_field field type in order to store some extra data.
Indeed when a youtube or vimeo video link is stored, only thumbnail image is copied on server and ...
1
vote
2
answers
602
views
How can I use function template_preprocess_field() to pass a value from one field to an attribute of another field?
I have an Entity Product entity where one of the fields is:
reference field on Media type with name Media Product Image
Media Product Image has fields:
Image
Custom color id
And in the developers ...
1
vote
1
answer
321
views
How to get file uri from entity video
I have some code to get video using view builder.
$view_builder = \Drupal::entityTypeManager()->getViewBuilder('media');
$storage = \Drupal::entityTypeManager()->getStorage('media');
$entity_id =...
0
votes
0
answers
51
views
How do I enable image styles after I update?
Since Drupal 7.91 update only images displayed directly through the Drupal interface (e.g. "thumbnail" displayed in the Drupal node edit form) work. Requests to any other image style (s/d/...
0
votes
1
answer
50
views
Reusable documents with media
With the Media module in the core of Drupal 9 in the Media type document there is the field field_media_document with the option "display".
When I use a Media field in a content type how do ...
1
vote
0
answers
180
views
JSON-API upload image file
I have been struggling to set up headless Drupal with React js. I did manage to upload the image via JSON API, as per instruction here
But I am not able to display the image. It would be great if ...
0
votes
1
answer
98
views
How can I display a larger image when clicking on a thumbnail for an image field? [closed]
Many of the answers are related to Drupal 7, but I'm asking for Drupal 8/9. I have an image field and currently display it as a 100x100 thumbnail. I want to link it to a larger image or make it into a ...
0
votes
1
answer
183
views
Get proper ID from media entity for file loading purposes
I'm attempting to load the file attached to a media entity used in a field attached to a paragraph in order to create a url to the file.
$vid = $paragraph->get($field_name)[0]?->entity?->...
0
votes
0
answers
37
views
Alt attributes are not updating even though I deleted alt in media items
I am trying to remove alt attributes for the decorative images to make them screen reader-friendly. I deleted some of the alt attributes and updated some from media library but the media being used on ...
0
votes
1
answer
344
views
Creating remote video media entity programmatically not generating thumbnail
Using Drupal 9.4.1, I am creating a remote video media entity programmatically and for some reason the title and thumbnail are not being created. They are created when cron runs so in my terminal when ...
0
votes
1
answer
409
views
Image styles - How to resize uploaded images and force an aspect ratio
I'm looking for a solution to resize uploaded images while maintaining a desired aspect ratio instead of cropping them.
We can configure some preset Image styles, but it seems we can only :
Resize : ...
0
votes
0
answers
27
views
Migrate update media / node + skip_on_empty plugin
I use a custom migration to update medias from an external JSON source. Inside this migration I use a custom plugin to search in database if the media name exist. If I get a 'mid' I want to update the ...
0
votes
0
answers
84
views
drupal-media ckeditor tag not well rendered for remote and local video
i'm running a 9.3.16 drupal site with media and media_library modules enabled. I've three types of media entities : video, remote video and image. I can upload and display the three types of media on ...
0
votes
0
answers
95
views
How to create a media entity via rest api
Getting a 422 Unprocessable Entity while trying to create a media entity via rest api. I've failed to find any docs regarding what params/entity type I need. This is how I usually create entities via ...
0
votes
1
answer
83
views
How to display in a block the media used in a node?
On my Drupal 9 installation, I created nodes with Media images integrated with CKEditor. This is not an image field in the node type, but an image embedded in node content with Media and CKEditor.
How ...
0
votes
0
answers
64
views
Images styles are not created in public directory with OpenLiteSpeed server
I've moved recently my drupal 9 website from nginx webserver to openlitespeed.
The website was working as expected, but now it is not. I've defined a rule when uploading a new image, it should be ...
0
votes
1
answer
119
views
Broken Image styles don't generate
I am on Drupal 9.3
Set the Private file system path in settings.php file $settings['file_private_path'] = '../private';
Create a folder name outside the "web" folder named "private"...
0
votes
1
answer
264
views
Generate a Media entity from a remote URL?
I want to create embeddeable "media" similar to how embedding YouTube or Vimeo videos work. When a URL is pasted in, I want to store this as a media entity (its own type) and then render it ...
1
vote
1
answer
338
views
How do I apply the `loading="lazy"` attribute to responsive media?
On my Drupal 9 installation when I create an "image" field, Drupal automatically adds the loading="lazy" attribute.
When I create a "media" field with an "Adaptive ...
0
votes
1
answer
132
views
Media Library results filtered by user
I am working on a project that will be using 100's users and potentially thousands of users. The users will be required to upload at the very least 5 images and possibly some PDF files.
Created a ...
1
vote
1
answer
483
views
Link in URL field to Media File
Before the Update to the latest DruPal 8, we were able to link to public://foo/bar.pdf to a file which was in /sites/default/files/. No the public:// prefix does not work anymore in the URL input ...