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
0answers
9 views

How to get the URL of remote video inserted by media field in block or paragraph twig?

How to get the URL of remote video inserted by media field in block or paragraph twig? I am using the paragraphs module to create video galleries from youtube videos. When I use {{ content....
0
votes
0answers
11 views

How to decode base64 image using pre save hook?

I am uploading image using jsonapi. But here the data is base64 format (As per requirement). Uploading to media entity. So I need to write a hook media entity pre save so that file uploaded should be ...
0
votes
1answer
27 views

I'm attempting to render responsive images and control art direction. Could somebody see whyI can't get breakpoints.yml to be respected?

I'm creating a title/ hero-image section that consists of two 50/50 columns at desktop but then stacks at about tablet (e.g. 1024px) I’m using a custom twig template for this content type. I want ...
-2
votes
0answers
14 views

How to make a slideshow with multiple content per slide?

My group is new to Drupal and we were wondering how to make a slideshow with multiple content and/or images per slide similar to the image shown below.. Those highlighted in blue are supposed to be ...
1
vote
1answer
19 views

How can I alter the form to add a new validation handler?

I'm on Drupal 8. I have created a new media bundle (permissions_json) which can be created from /media/add/permissions_json, where administrator user can upload specifically formatted JSON files, and ...
0
votes
1answer
21 views

How do I configure Content Security Policy for base64 images?

I'm using the Content Security Policy module and I placed restrictions on img-src. Set to Self. Additional sources: https://www.google-analytics.com https://ssl.gstatic.com https://www.gstatic.com ...
0
votes
0answers
15 views

Derivative images are generated in Private filesystem but the editor shows a non existent public folder path

Im saving my images into a private filesystem. The derivatives are also generated in the same private filesystem. When the images are uploaded, the thumbnails are displayed but after the node is saved ...
1
vote
2answers
37 views

How to find the url of a media library image field in a preprocess function?

I have a preprocess function that I am using to grab one of 3 profile images. Basically we're replacing a couple stand-alone image fields with a media library reference field. The goal is to display ...
0
votes
0answers
15 views

Php Error Media Library Add button not working?

I have imported config files of content types, paragraph from my site to other site. Media Library Config files are also available. Enabled the Media Library module and imported the config files. ...
0
votes
0answers
23 views

Manage media per user without using the Media Manager widget

In Drupal 9, I have users loading audios into their profile. When logged in, users should only see their private audio media in the media manager. This works well with a contextual filter, as long as ...
0
votes
0answers
14 views

How to select the user desired crop in the “Manage Display” section of a paragraph type for an image field?

I'm currently using ImageWidget crop to give some aspect ratios for users to pick when editing content (1:1, 1:2, 2:1, 2:3, 16:9), that is properly set up in the "Manage Form Display" ...
0
votes
0answers
16 views

Media 'external video' requests iframe over http instead of https, leading to mixed content errors and blocked video

I have a drupal 9 site where I use the media library. I've created a media type with source "External video", allowing youtube videos. As far as I can see this uses oEmbed. I've added a ...
0
votes
0answers
24 views

How to make a form alter for uploads via the media library modal

By default the 'name' basefield is hidden on media entity forms and a name is automatically generated from the file name. The media name is displayed and is searchable in the media library. This ...
0
votes
1answer
14 views

Twig: Display media library reference user image at particular resolution with alt tag (on /user/1231 page)

On our user page (/user/12345) we want to change the profile image field to be a media library reference field instead. I've created for the user object a new field called field_profile_image that is ...
0
votes
1answer
17 views

How to display a field when a media is uploaded to the media library field?

I have block settings form where I have a media library field. public function blockForm($form, FormStateInterface $form_state) { $form = parent::blockForm($form, $form_state); $user_input = $...
0
votes
0answers
6 views

overriding core asset ckeditor js to remove ckeditor media edit button

When embeding a media in ckeditor, using the media libray, an edit button is added. Since the editing does not allow to modify custom fields , i would like to remove or hide that edit button. https://...
0
votes
0answers
9 views

table media doesn't exist when accessing /admin/modules as /admin/content/media pages

When I try to visit /admin/modules/uninstall, or even /admin/media, the browser shows the following error: Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: ...
1
vote
1answer
65 views

Media library widget: Table instead of grid?

Background I have a multiple-value entity reference field with target type = media. It is used for "document" media, so mostly pdf files. I am using the "Media library" widget ...
0
votes
1answer
19 views

Token does not return full dynamic path to Media Image URL

I'm having trouble configuring Metatag for Open Graph and Twitter Card images. I'm using Drupal 8.9 core Media Image reference field as the source. [node:field_hero_image] (Entity reference field) ...
0
votes
0answers
24 views

plupload upload fails with 500 Error code: 104, message: “Failed to open temporary directory.”

I installed "drupal/plupload": "1.x-dev@dev", "drupal/plupload_widget": "^1.0", "moxiecode/plupload": "^3.1" and configured a upload form ...
0
votes
1answer
58 views

How to create Media entity and attach to user field

I'm trying to import user profile pictures from Drupal 7 to Drupal 8. So far I've managed to upload the picture from the url and save it to the file system, create Media entity and use the user id as ...
0
votes
0answers
28 views

How to show media only to owners?

In order to allow users to add a remote video from Youtube, I am using the media type in a custom content type. When users create a node of that content type, and add a media, they get a list that ...
0
votes
1answer
40 views

Where are the field formatter settings?

When I'm managing a display for an entity and select a field formatter, some formatters have options available (see screenshot 1). However, when I use that same field formatter in Views, there's no ...
0
votes
1answer
21 views

How do I get the public file URI for a media file from jsonapi?

I have an audio file that is stored as Media of type Audio. Now I want to get the link to that file that is usually displayed to site users via jsonapi. For example, when the media entity is rendered, ...
1
vote
1answer
127 views

How can I add player parameters to a core oembed field for a youtube video?

For example, if I enter this url that contains the player parameters to remove controls and autoplay, oembed field on my media type does not allow it ("The given URL does not match any known ...
0
votes
2answers
64 views

Image Files Uploaded via REST got Temporary status - Cannot be refereced by Media Image

Drupal 8.9.11 Image File Uploaded via REST gets "status - Temporary" while setting explicitly "status" case to True server error 403 (code in python) "status": [ ...
0
votes
1answer
152 views

How do I set the height and width for images that use a responsive images style?

When using the core Image module, the height and width of images are automatically set. But when I use the Responsive Images module and a Responsive Image style, then no height or width is set. Users ...
-2
votes
1answer
25 views

Is there a way to add bulk media upload in the modal dialog when using ckeditor and entity embed?

I was a heavy D7 developer and I skipped 8. Now I'm trying to build some sites in 9. Just wrapping my head around what's in core and contrib to get what I need. I was wondering what methods people are ...
0
votes
2answers
76 views

Get parent entity in media preprocess hook [duplicate]

I am having a paragraph with a media entity ref field "field_paragraph_image_ref". I would need to modiy the media twig template depending on a field value of the parent, which is a ...
0
votes
1answer
29 views

Media html not rendering in blocks

I'm experiencing an issue on multiple sites where (image) media aren’t appearing in blocks despite working fine in node fields. I first thought it only happened to me when using the linkicon module, ...
0
votes
1answer
47 views

Image Style issue

I have created an Image style which I am applying in my Blog view. But the Images are not generated in the Blog View Image folder and hence it is not showing up because of the path issue. sites/...
0
votes
1answer
70 views

Get media image url in views-view-unformatted template

I'm using drupal 8, in my template I created a file named views-view-unformatted--block-12.html.twig and this is it's content: <div class="row list"> {% for row in rows %} {% set ...
0
votes
1answer
26 views

Is it possible to link images to different URLs?

Using View's module it is possible to create a page to display some content horizontally. I have done this using carousel feature. The content type that these contents belong to have an image_field ...
1
vote
1answer
155 views

Missing updates for Media

After much package dependency finagling via composer, updating PHP, updating MariaDb, etc.. (not as bad as D7 => D8 but still harder than I'd hoped) I managed to update from 8.9 => 9.0.7. I was ...
0
votes
0answers
81 views

How to create a 'button' which is linked to a Media Document with custom Link text?

I am trying to create the ability for a content editor to add a button to an entity which links to a Media Document. Essentially the requirements are that we can upload a file and that file is ...
0
votes
1answer
78 views

Why is step 2 of file to media migrate giving me missing bundle error?

I am following the instruction on this page : https://www.drupal.org/project/migrate_file_to_media/issues/3118471 , but with media of bundle document, not image. I have my step 1 yml on this issue ...
2
votes
0answers
119 views

CKeditor Media Edit: AJAX HTTP error 500 [closed]

How can I fix the AJAX HTTP error 500 to make the "Edit media" button in the body of the CKeditor work? I am trying to use the "Edit media" function to edit an image, which was ...
0
votes
0answers
51 views

How do I pre-fill a image field in a form with javascript

I've got a form which I want to fill with javascript on a button click. This button click retrieves the data via a javascript call. All regular fields are no issue, I just cant seem to be able to pre-...
0
votes
0answers
37 views

Using Feeds, how to import D7 files and images into a D8 media field

Looking for a method for importing D7 files and images with multiple values into a D8 media field. Any recommendations out there? The official Feeds issue doesn't have much activity and seems to have ...
0
votes
1answer
49 views

Trigger Crop API programatically after node is created

Hi I am using Image Widget Crop so that users can crop images according to predefined image styles. All would have worked fine without any issues had I been using Drupal in the conventional '...
0
votes
1answer
60 views

How to create Media video youtube entity programmatically? [closed]

I have file with multiple Youtube URLs such as: https://www.youtube.com/watch?v=asddasOds32 https://www.youtube.com/watch?v=kjh234hknnn https://www.youtube.com/watch?v=iZ53yuirewn ... I need to fill ...
1
vote
1answer
44 views

Deprecated Dependency Warning not removing

In my Drupal 8.9.6 (Installed with Lightning distribution) Status Admin Page, there are three warnings showing after updating several modules and core to the latest versions: DEPRECATED DEPENDENCY: ...
0
votes
1answer
57 views

How can I auto-rotate an image on file upload in a custom form?

I'm using the FAPI to provide the user an upload field for an image. The field is: $form['product_img'] = [ '#type' => 'managed_file', '#description' => 'Upload a PNG or JPG image of the ...
0
votes
1answer
20 views

Link video (media_youtube) to node

I have a content type called 'webtv' for adding videos from youtube with media, media_youtube modules. On the webtv page I want to add blocks with video preview image and node title. My problem is ...
0
votes
1answer
38 views

How to remove images from body field in views?

In the body field of a content type, I have added an image at the start. In my view, I want to show 200 characters from the body field. It also prints the image. How can I skip the photos from the ...
0
votes
0answers
44 views

bootstrap_barrio subtheme breaks ckeditor's media insert in custom block

I'm facing this problem (seems to be producible) in a contrib theme that breaks the ckeditor media insert button on custom blocks in the layout builder of individual nodes... The javascript error says ...
0
votes
0answers
59 views

How do I display media in a colorbox?

The colorbox module functionality is now part of Drupal core media module, that is what i read in the colorbox project page. However, I can't find documentation or guidelines how that actually works. ...
0
votes
1answer
16 views

Programmatically setting video_embed_field URL

I am trying to populate nodes programmatically from a feed (migrating earlier site to Drupal 9). So far I have managed to get everything else to move, but I can't figure out, how to set ...
1
vote
1answer
40 views

How to render text including video embed field

I have a formatted text field, and am using the video_embed module to allow users to embed video into that field, using the video_embed_wysiwyg submodule. I am then trying to render the field in a ...
0
votes
1answer
67 views

Scheduled unpublished content and media that is under content moderation

Let's say you have a need for the following: Content is created with content moderation, with various states. After a set amount of time, the content is deleted or archived. The user can set when ...

1
2 3 4 5
54