Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [media]

Use it for questions about the module for managing files and multimedia assets: the Media module.

0
votes
1answer
17 views

Drupal 8 - Can't get media path (video)

I can't manage to get the video link of a media, I can achieve this with a picture but with videos it doesn't work. Here is my code : function slider_get_uri_by_media($media, $style = 'background'){...
0
votes
0answers
38 views

Entity with custom field, how to get these field in template?

I have created a Slider entity with the drupal console, with the website interface I create some fields to this entity (field_image, field_title, field_subtitle), but I can't manage to get these ...
-3
votes
0answers
22 views

Missing alt and title HTML image properties in Acquia dam

I have created a content type with an media field [ media type - Acquia DAM Asset ], I noticed, this Acquia DAM does not have the provision to enter image ALT and title by default, Can you please ...
0
votes
0answers
15 views

Alternative to hook_node_access for Media entities (Drupal 8.6)

It seems that hook_node_access does not fire for Media entities. Is there an alternative hook, or some way of forcing Media to use hook_node_access?
0
votes
0answers
29 views

How can I replace static file and media links in content with their equivalent entity references?

I imported content from another system. So, for example, the body has typical html, like this: <img src="/images/image.jpg /> All of the media assets that are referenced as static html, those ...
0
votes
1answer
21 views

Display related media entities

We are using the Basic Page content type and it has an Entity Reference field (field_document) that points to the Document (Media bundle), which has a field_document_tag (taxonomy term field). The ...
0
votes
0answers
21 views

How to prevent running “updb” twice for upgrading Media

I'm upgrading my custom media modules to use the "core media" in Drupal 8.4.8 I have to run the command "drush [sitename] updb" twice in order to recognise my custom media modules code has been ...
1
vote
1answer
157 views

Will my managed file get deleted?

At this url: /admin/config/media/file-system There is a setting: Delete temporary files after X hours Does this specifically refer to files in /tmp ? Or whatever I set as my temporary folder? Or ...
-1
votes
2answers
61 views

How do I programmatically get the URL of an entity referenced media image field using on a custom_preprocess_html() hook on THEME.theme?

Reason: I need to create an Open graph meta tag og:image and pass the URL as content. On THEME_preprocess_html(), I loaded the node using $node = \Drupal::routeMatch()->getParameter('node'); if (...
0
votes
0answers
28 views

Media & Media Entity Browser upload problems

I am using the following: Drupal 8.6 Media Media Library Media Entity Browser 8.x-2.0-alpha1 Inline Entity Form 8.x-1.0-rc1 Entity Browser 8.x-2.1 Entity Embed 8.x-1.0-beta2 Mainly to upload ...
0
votes
0answers
12 views

Media Video Display as Playlist

Love the new media in D8 but I was wondering if it is possible to a video playlist. Basically we have a Media type called Video. Then we attach it to content type as an unlimited filed. When we ...
1
vote
0answers
53 views

How a media image entity_reference field in a custom content entity can be set to translatable?

I created a media image field in my custom entity content: $fields['image'] = BaseFieldDefinition::create('entity_reference') ->setLabel(t('Promotion image')) ->setDescription(t('...
0
votes
0answers
12 views

Change form widget depending on role

I have a form open to public anonymous users. They can upload images to the private files directory. Only logged in users editors can see those images. When a new node is submitted by an anonymous, ...
0
votes
0answers
10 views

Removing images from node gives Cannot be modified error

I am using the latest drupal 7 version 7.64 and using multi plupload module for uploading images with drupal's bundled image field. The problem occurs when I try to remove an image then try to save, ...
0
votes
2answers
67 views

Where in The Database does File Usage Data Come From

How does data in file/[id]/usage get compiled? From what tables does it determine a use? Is there a way to track down how/where it gets this data and troubleshoot? Does it take include revision data?...
0
votes
1answer
44 views

Youtube media thumbnail size

I want to control the thumbnail image size for my media entities of type video. The thumbnail image size being fetched by the media module from Youtube has 480 x 360px. I want to use the 1280x720 ...
0
votes
1answer
15 views

Within a View, How do i paginate the content found inside a single Multiple file field, i.e. inside one node

Hopefully someone can help. I am using a file field and allowing unlimited files within a single content type field called "Video", handled by Media Module. I have created a view per "gallery" of ...
0
votes
0answers
13 views

Entity Reference Field - Videos

I am trying to use a entity reference to get the media value by using the target id to create a uri and url. The problem is that the way it is working now is that the id is grabbing is node id and not ...
0
votes
0answers
15 views

Can I build a product extranet that lets me export product information as csv with drupal 8 and existing modules?

I am trying to build an extranet platform (using drupal 8) where suppliers can create new products and request approval of those products. Once approved by myself they get a notification that they can ...
1
vote
0answers
41 views

Cannot update my website from 7.60 to any higher version

My website is currently running on the agov-7.x-3.x-dev core and the 7.60 drupal core version. I tried to update the site to Drupal core 7.61, but site showed a fatal error. Fatal error: Class '...
1
vote
1answer
175 views

When adding media to content, how can I search for the media by tag or term?

In Drupal 8, I created a new Media type "PDF Files." I have imported almost 30,000 of them, each complete with Title (Name), file, and the taxonomy that categorizes them. On the content type (Let's ...
0
votes
0answers
21 views

Dont show results a user has no permissions to

I have created a view that list media entities that are related to the module: Groups. These documents have certain restrictions to them. Each document can get 1 of 4 permissions: Permission A ...
1
vote
0answers
111 views

How capture video thumbnail , when video is uploaded under media video type file?

I'm using Core media module to upload video[Media Type is video,which has field video of 'file field type']. This module will refer video.png as thumnail for all video uploaded from the local system. ...
1
vote
1answer
53 views

Get Link value in Media entity

We have a Media type called Documents that has a Link field called field_link. We need to obtain the URL (external or internal) from the field so that we can use to wrap block elements inside of a <...
1
vote
1answer
31 views

Why are media files used in zero places not deleted?

Unused media files (.jpeg .mp4 etc.) are remaining permanently even though unused. This is shown in the /admin/content/files page in our Drupal 8.6.3 system. It could be that, at migration from ...
1
vote
1answer
122 views

Media Module: How to enable SVG files

I can currently upload with an Image field for SVG. I am using the SVG image module. I just installed the Media module so I can use the Media library functionality. However when I add a new Image ...
-3
votes
1answer
38 views

How to download a file from a system folder when a link is clicked? [closed]

I have a file("abc.csv") that is stored in the local system (for example: /var/a). I need to download the file when I hit a link in a Drupal site.
2
votes
1answer
57 views

Naming conventions in Media entity vs File entity

The Media Library experimental module in core introduces a generic media type "file", while File entity calls the same thing "document". For comparison, the other bundle names are consistent between ...
2
votes
1answer
525 views

Get Video URL from Media Entity reference field

I have an entity reference field to Media Video. I'm trying to get the uri to the video file in node template. Most of the solution I found around is regarding Image/File. But not Video. Tried Twig ...
0
votes
1answer
82 views

Image upload: Failed to open output stream

I created a media entity browser and for the image upload widget i choose the DropzoneJS.The widget settings are in the image bellow, pretty standard. And regardless of image type (png, jpg, jpeg) ...
0
votes
1answer
59 views

Can't import configs on server due to some entities

So when i try to manually import configs (/admin/config/development/configuration) i get these messages: Entities exist of type Media and Media type Image. These entities need to be deleted before ...
0
votes
0answers
58 views

how to view media revisions

hi I see that media revisions are now in the latest drupal version, and it looks like there is code to allow viewing the revisions for Media, but I cannot find the path or what has to be enabled to be ...
0
votes
1answer
32 views

How to display current pages the media entity is referenced during deletion?

We are using Media Entity module that provides a Document media bundle. On our Article content type, we have created an Entity Reference field to Media that is set to Document media bundle. When you ...
2
votes
0answers
2k views

How do I practically use the media library?

Now that Drupal 8.6 is released, I tried the experimental Media Library module. It works great, but it needs some additions. How can I use core Media Library with CKeditor? How can I fill custom ...
0
votes
1answer
63 views

Two step media creation form?

It would seem very logical to pick the media source first, and then have the field map mechanism fill in the fields based on the metadata the source entity provides via the media source plugin. I am ...
1
vote
0answers
388 views

How can I add classes to images added in CKEditor via Media?

Similar question to How to set width to Media entity image in CKEditor BUT I am trying to do more than insert various sizes of images, I want to add classes to the actual img tag. So when I insert an ...
0
votes
1answer
55 views

How to use (reference) the uploaded file to a media(video) type?

I have read https://www.drupal.org/node/2941420 and I can upload a image file then use it in article. But I can not use it as video field after I upload a video file. My Drupal version is 8.6.0-...
1
vote
1answer
282 views

How can I create multiple cropped Media images without re-uploading them?

Solutions that I've found allow to crop Media, type Image when I've uploaded an image, but the media entity is not yet created (on the "Add media" page). I need to upload a large full image once (and ...
1
vote
1answer
42 views

I am not able to override the form #access setting [closed]

I cerated a form alter with the file entity media upload browser. I studied this answer of how to alter this form. I then debugged and found that for what I wanted to do, I am in step 4 of the file ...
0
votes
2answers
605 views

How to get fields of media_entity?

We have a view that returns a Media_entity (Drupal\media_entity\Entity\Media) using the following in a hook_preprocess_view_views hook. When we try to access the field_media_type variable, I get a ...
1
vote
2answers
466 views

How can I use a media field in a custom form?

I tried something below, which is not working in drupal 8. $form['upload_documents'] = [ '#type' => 'media', '#tree' => TRUE, '#title' => t('Upload your ...
2
votes
2answers
244 views

Display a Media Entity Image from other (referencing) node in a Twig template

Seems that all found in the Internet does not work for my case. :/ In general, I need to display an Image and a Project, referenced by the node that has a reference field to my node. I have: a node ...
0
votes
0answers
35 views

How do I get a direct download from a path like /media/<media id>?

i'm wondering how anyone using drupal 8 is handling files using the newly added to core media module. For example, uploading a document using media module, to be linked to by multiple pieces of ...
0
votes
1answer
37 views

Gray overlay and no dialog when clicking Image button in CKEditor

Attempting to get CKEditor and Media to work together on a Drupal7 site. Things are mostly working great, but when I click the regular Image button (or double-click an image, or use the context menu ...
0
votes
0answers
11 views

Media library: don't include profile pics or remove from library without deleting

Our site allows users to create a profile avatar. We are also using the media module, version 2.19, which includes a media library. The library is useful, however, all of our users' profile images ...
-2
votes
1answer
519 views

Custom migration: image fields to media [closed]

When migrating existing Drupal 7 fields, most things work. I need to convert images (using image upload) in Drupal 7 site to reusable media. Any help?
0
votes
0answers
45 views

Deploy Media Field Images From Staging to Production

I'm trying to find a way to copy nodes (plus associated images) and (ideally) users from a Drupal 7 staging site into production. In theory, this "Deploy - Content Staging" module is perfect: https:/...
0
votes
0answers
229 views

Link to a Media entity file from text editor

The idea is to create an hyperlink on some arbitrary text typed in CK Editor. That link should target a file uploaded to a Media file entity. Media entity download filter already makes it possible ...
0
votes
0answers
168 views

Change image paths from absolute to relative.

I have a Docker-Drupal 8 multi-site app in production, created by a third party, where every image uses an absolute path, so they get served from an unique server which makes the sites slower. Being ...
0
votes
0answers
20 views

How (if even possible) can I get a field value from an unsaved parent entity to use in a referenced entity?

I have two media types: Document (main) Name DocID Description Year Main file (file reference field) Supplemental files (optional, multi-value media reference field) Document (supplemental) Name ...