Stack Exchange Network

Stack Exchange network consists of 174 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

Questions tagged [media]

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

-1
votes
0answers
18 views

I need a hook to media insert [on hold]

I need to know if exist a hook when some user add a content media in a kind of media type. I tried to use the hook_ENTITY_TYPE_insert() but it doesn't work for media.
-1
votes
0answers
17 views

How do I go straight to file? [on hold]

So I enabled the Media module and added some PDFs to it. Having a little difficulty trying to link the files from a page. This works. /sites/default/files/2018-12/Website%20Account%20Disclosure%...
0
votes
0answers
11 views

How to stop automatic wrapping of text around image in content wrapper

I am using Drupal 8.6.3 and theme "Drupal 8-W3CSS Theme". I don't have much technical knowledge about Drupal by this I mean, the coding, templates, access files etc. I don't know php at all. I am ...
-1
votes
0answers
25 views

Website Down due to memory exhaustion in the media module [closed]

Website was down due to memory exhaustion in the media module.What might be the route cause for this?
0
votes
0answers
28 views

Convert Media tags to Markup in database

I am preparing my Drupal 7 site for redesign and need to convert the media tags in into HTML as they are saved to the database - not when the page is rendered. So, I need code like [ [ { ...
1
vote
1answer
15 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 ...
0
votes
0answers
35 views

Set an image as an image style programatically

We are trying to import a 18,000 image from an antiquated Alfresco system into Drupal 8. The old system already created cropped versions of the original assets that need to be kept and used in news ...
0
votes
0answers
18 views

Upload images from database for an article

When creating a new article, usually I want to upload the same image which I uploaded for a previously article, but I dont have this option available. So Im thinking if there is any way to upload from ...
-3
votes
1answer
36 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
48 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
95 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
21 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
0answers
23 views

Custom media library selection view

I'm trying to create a custom Media Library widget, to apply to only a specific media field. I'm using core Media (8.6) and not the contrib module. Basically I want a custom selection on media (...
0
votes
1answer
27 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
54 views

Contextual filter in media browser view not accessible on autocomplete filter ajax call

I'm having a view which filters Media type and has contextual filter of Entity browser context. This view also has an exposed filter of text box field with autocomplete enabled which filters by media ...
0
votes
0answers
13 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
31 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 ...
1
vote
0answers
584 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
0answers
14 views

Get URL from within modal

I'm using the Media Browser Plugin for Drupal 7 to allow users to upload content via a modal window when creating a new instance of a content type. The Media Browser shows several tabs (Uploads, ...
0
votes
1answer
62 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
142 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
30 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
74 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
31 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
204 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
votes
2answers
141 views

How can I use media fied in a custom form in Drupal 8?

I tried something below, which is not working in drupal 8. $form['upload_documents'] = array( '#type' => 'media', '#tree' => TRUE, '#title' => t('Upload your documents'), '#...
2
votes
2answers
156 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
27 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
21 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
10 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
258 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
33 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
81 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
100 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
12 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 ...
1
vote
1answer
18 views

How can I set the default value for a Media form element?

I am using Media 2.0 and a media field in a custom admin form. I am trying to set the default value as described on https://www.drupal.org/project/media/issues/1158760#comment-12656764, but `#...
3
votes
0answers
77 views

How to convert an existing D8 image field into a Media Image reference field?

I have an image field that I created before Drupal 8.5, when media was introduced in the ui. The field already contains content and I would like to make use of the reusable media functionality that is ...
1
vote
3answers
57 views

Rendering semantic HTML5 caption

Is there a way to render HTML5 captions in Drupal 8? I've tried with embedding images and embedding media in the WYSIWYG, and I've also tried with media migrated from D7 to D8, but nothing works. An ...
0
votes
0answers
20 views

Remove character limit for Caption on CKEditor with Media embed

I need to remove or overwrite the maxlength attribute for the caption (currently 128). There is another similar/identical question on this website, but the solution provided is not working. Is there ...
0
votes
1answer
220 views

Problems upgrading Media from 8.3 to 8.5

I have a Drupal 8.5.3 site (built from the composer project) that was previously on the 8.3 branch before the critical security updates forced me to update to 8.5. One of the things I missed in the ...
0
votes
0answers
57 views

Entity Browser Widget Validation

I am using Drupal Lightning 8.x.2.2.3. I want to restrict the file upload extension to only jpg , gif when uploading through the Ckeditor. I am using the Entity browser File Upload Widget. Currently ...
0
votes
0answers
53 views

Media browser Embed button does not restrict library to selected file entity bundles or Media type

I am using Drupal Lightning 8.x.2.2.3. And I am using the the built in Lightning Embed button (the one with the Star icon) added to the Ckeditor to add media to the body. The Embed button is using the ...
1
vote
1answer
208 views

How to convert the drupal-entity tag into an img tag?

I have a content type with a text field that uses CKEditor, in the editor is possible to add a media entity image, once the image is inserted inside the text the html tag for it is: <p>Document&...
0
votes
0answers
31 views

Is media _oembed in Drupal 8

The media_oembed page shows only D7 versions. Since media has been ported to Drupal 8, I was wondering if the module includes this functionality.
3
votes
1answer
546 views

Selecting an SVG as an Image Field value

I have a Content Type, News, with an Image Field, News Icon. When the field settings are viewed at /admin/structure/types/manage/news/fields/node.news.field_news_icon I have supplied SVG as one of ...
0
votes
0answers
46 views

Specify the widget type for a form field which doesn't have a related entity

We have a custom form with an image field and want to use the entity_browser widget from the File Entity Browser module, however it isn't displaying the uploaded content. The code we have so far: $...
0
votes
0answers
18 views

How to change look of entity browser

I've been trying to figure this out for hours but I can't change the layout of the entity browser to look like it should see below It always appears as follows - Am I missing something please?
0
votes
1answer
253 views

Media theme missing from the file system?

Not really sure about this error, I wasn't aware there was a media theme but could anyone help me understand this please? User warning: The following theme is missing from the file system: media in ...
0
votes
0answers
25 views

I don't have any media entity browsers in my installation, how to upload media

I am trying to create a field to browse and upload media in my paragraphs type such as images but I am struggling to create an entity browser that doesn't give me the error that what I am trying to ...
1
vote
1answer
95 views

Is media-7.x-1.x vulnerable to SA-CONTRIB-2018-020

The Drupal Media module version 7.x-2.x contains a remote code execution vulnerability which was patched with: https://cgit.drupalcode.org/media/commit/?id=1cd77ffa9c2cf96d80b76d47318179a8a82f0d46 1....