Questions tagged [media]

Drupal core has some modules to handle images and other media files, for example the Image module and the Media module.

Filter by
Sorted by
Tagged with
0 votes
0 answers
31 views

Error with Quick Node Clone module - Non-reusable blocks must set an access dependency for access control

I am on Drupal version 10.1.6 and am using the Quick Node Clone module (v1.16). I can clone any nodes/pages and that all works fine. Most of my pages, if not all, are using layout builder where I can ...
Akbar Bakhshi's user avatar
0 votes
1 answer
47 views

I can't upload images

I can't upload images with CkEditor 5 in my Drupal 10.1.6 website (which runs on PHP 8.2); all the other features work fine. In my recent upgrade of Drupal, I switched directly from Drupal 9.4 to ...
PtitBreton's user avatar
2 votes
0 answers
63 views

Media library filtered results are broken after a new media item is added [closed]

After recently updating from Drupal 9.5.11 to 10.1.5 we have spotted some issues with the results displayed in the media library widget. Basically if I filter results, for example on the string "...
Mathew's user avatar
  • 313
0 votes
2 answers
112 views

How do I render a Media Entity Reference image field in template_preprocess_node()?

I'm altering the way images are rendered in the node preprocess function, and it is working exactly as expected for images in "Image" fields: $field_view = $fields['field_image']->view(['...
safetypin's user avatar
4 votes
2 answers
387 views

Why are media items no longer available at /media/{id}?

I'm using the Media module, but I noticed there isn't a path like /media/%id where I can see the media and its fields. The only path available seems to be media/%id/edit and media/%id/delete. On ...
arrubiu's user avatar
  • 3,212
0 votes
0 answers
20 views

How to prepopulate "caption" field in the wysiwyg from a media library field, field_image_caption

We were hoping to have unified captions maintained in the media library. I added a caption field to the "image" media type, "field_image_caption". That's great for places where ...
Patrick Man's user avatar
0 votes
0 answers
42 views

can't embed Rumble videos in oEmbed providers module

I've got oEmbed providers installed on two sites and recently wanted to add rumble to the list of providers. I've created a new provider bucket and included rumble but if I try and add a rumble URL or ...
TheyCallMeTiny's user avatar
1 vote
0 answers
10 views

How can I add the hero section image in the View to REST_API?

Hello im using Drupal 9.5.9 version. How can I add the hero section image in the View to REST_API? I have created an api with Rest_API to fetch data from Views I have created. I have no problem ...
devr4n's user avatar
  • 11
1 vote
1 answer
90 views

The website encountered an unexpected error after the media module was uninstalled. The "media" entity type does not exist

This is a Drupal 9.5.10. After uninstalling the Media module. The website encountered an unexpected error. The error message only shows a little information, as I know. It mentioned the "media&...
CocoSkin's user avatar
  • 889
0 votes
0 answers
89 views

CKEditor5 Medialibrary insert add custom classes

For my text-format i have "drupal media insert" in my toolbar, when choosing an image to insert there are options to align the image, i.e "align left break text" it will add a data-...
john Smith's user avatar
0 votes
0 answers
45 views

Menu links to media library items

Is it possible to link to media library items such as documents and images rather than be restricted to content nodes? Fairly new to Drupal development and thought this would be fairly standard but ...
Monki's user avatar
  • 1
0 votes
1 answer
23 views

Extract image meta data and set field values on Media upload

I'm extracting IPTC and EXIF data when the user uploads an image using the Media Library UI. Using hook_form_alter I can get the URI of the uploaded file in the media_library_add_form_upload form, and ...
Tim's user avatar
  • 1,367
1 vote
1 answer
176 views

Media library vs entity browser [closed]

I am creating a brand new multilingual drupal 10 site and I have to choose between Media library and Entity browser for the manage form display of my media reference fields. I have searched all over ...
Mira chalak's user avatar
0 votes
1 answer
141 views

How do I get a media entity image's url/src in a block twig file?

I have a custom block type that has a media entity field that is an image. I want to extract that image url and set it as a div background image in the html.twig file, but I can't get it to work. The ...
Eluchel's user avatar
  • 325
0 votes
1 answer
49 views

Style image is not created

I have a D7 (7.72) news website (multi-lingual), it started on 2023-06-07, that no image upload or update could create style in sites/default/files/styles although it uploads to the sites/default/...
user3532287's user avatar
0 votes
2 answers
122 views

How to set media library widget so that allows only certain dimension images for each field?

I'm trying to find a way to set some image dimension limit for the media library widget. That will allow me to restrict on which image sizes can be selected based on the fields they are using them. I ...
Alimba's user avatar
  • 117
0 votes
2 answers
327 views

Embedded images are not working in CKEditor 5

While migrating CKEditor 4 to 5, images added through entity embed ( E ) option in CKEditor 4 is not appearing after switching to CKEditor 5. Any idea how to make it work in CKEditor 5? in CKEditor 4 ...
pvh's user avatar
  • 1
1 vote
0 answers
69 views

Best way getting video url for paragraph on a node with a field video (media core)

When I have a paragraph on a node with a field video (media core), is there another good practice to get the URL of the video? I have this in the twig-file field--paragraph--field-video.html.twig: ...
Thomas's user avatar
  • 11
3 votes
0 answers
134 views

File can not be copied during migration of media entity

I'm migrating pictures into Drupal (9) media entities (image). System is using AWS S3 for local storage. I have 2 migrations: First migrates external images into drupal's files. It copies files from ...
MilanG's user avatar
  • 499
0 votes
0 answers
100 views

Select media popup is not opening after upgrade ckeditor from 4 to 5 Drupal

We have drupal version 9.5.7 in our website, When we had upgrade ckeditor4 to ckeditor5 then Select media popup(for image and video) is not opening. Console error: ajax.js?v=9.5.7:411 An error ...
Jasbir's user avatar
  • 101
0 votes
1 answer
714 views

How can we resize a Media Image inserted using Ckeditor5?

D9.5 - Ckeditor 1 (v5) We have Media Images and are using Ckeditor's "Insert Media" button in the WYSIWYG but we cannot resize the images. Is this possible with Media images?
quantumized's user avatar
  • 1,177
0 votes
1 answer
48 views

How to enforce a specific aspect ratio for all Media images?

With the core media Image type, I want to restrict uploaded images by aspect ratio. I want to block images that have the wrong aspect ratio from being uploaded. My question is the same as this Drupal ...
Patrick Kenny's user avatar
0 votes
1 answer
312 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 ...
RafaTicArte's user avatar
0 votes
1 answer
292 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 ...
sidgrafix's user avatar
0 votes
0 answers
47 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 ...
GradoniusTheWise's user avatar
0 votes
0 answers
27 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 ...
bigmike7801's user avatar
0 votes
0 answers
33 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 ...
tanbog's user avatar
  • 1,243
0 votes
1 answer
49 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 ...
MilanG's user avatar
  • 499
2 votes
0 answers
119 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 ...
ShadowAce's user avatar
1 vote
1 answer
62 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 ...
MilanG's user avatar
  • 499
1 vote
1 answer
300 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:
Alejandro's user avatar
2 votes
1 answer
541 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 - ...
isin's user avatar
  • 109
1 vote
0 answers
40 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 ...
CanardPpc's user avatar
0 votes
1 answer
397 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 ...
paul cappucci's user avatar
2 votes
0 answers
519 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 ...
greggles's user avatar
  • 5,242
0 votes
0 answers
236 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 ...
Rico's user avatar
  • 1
0 votes
0 answers
150 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 ...
Giuseppe's user avatar
  • 907
1 vote
1 answer
42 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 ...
GradoniusTheWise's user avatar
2 votes
2 answers
1k 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 ...
Vitaliy K's user avatar
  • 109
0 votes
1 answer
121 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); $...
gMaximus's user avatar
0 votes
0 answers
180 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 ...
af_elkb's user avatar
0 votes
0 answers
64 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 ...
beltazzar's user avatar
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 ...
anthony3d's user avatar
0 votes
1 answer
161 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 ...
vyshnavi's user avatar
0 votes
0 answers
323 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 ...
Pedro's user avatar
  • 144
1 vote
2 answers
2k 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 ...
erik's user avatar
  • 21
1 vote
1 answer
592 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 =...
Aldi Alhafidzi's user avatar
0 votes
1 answer
67 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 ...
nicola's user avatar
  • 21
1 vote
0 answers
262 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 ...
Rdb's user avatar
  • 11
0 votes
1 answer
225 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 ...
Patoshi パトシ's user avatar

1
2 3 4 5
56