The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [media]

Drupal core has some modules to handle media files, such as the Image module (Drupal 7) and the Media module (Drupal 8). Other modules handling media are third-party modules.

Filter by
Sorted by
Tagged with
0
votes
0answers
26 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 ...
0
votes
1answer
34 views

What do I need to pass to the Image class as the first parameter?

I'd like to use the Image API directly to perform few simple operations with images (I'm aware of image styles and for various reasons I would prefer to not use image styles for the application I'm ...
0
votes
1answer
112 views

Optimize image that does not have an image style

We are using the imageapi_optimize modules with the imageapi_optimize_resmushit. We are able to flush the caches for all the image styles and see an improvement. However, there are images that are ...
0
votes
0answers
19 views

Field_image width in views

I need to build a view with image width and height available in the node devel tab (see image). In the view field list, I can't find those. How can I have these values in my view? note: Having ...
1
vote
1answer
53 views

How to use articles attached images as background of a div

I'm doing my first site on Drupal 8 and I have a problem. I would like you to help me. In fact I'm trying to get the articles attached images as a background for a div created in the page templates. ...
0
votes
2answers
52 views

Output image src via JSON [closed]

I have worked out how to use dynamic routing and JsonResponse() in a custom controller to output pure JSON, with no HTML at all. I would like to do the same with an image — for the page to output an ...
0
votes
0answers
21 views

Image alt tag not saving on save/edit

I have a content type for gallery photos which has a Image data type. When I create the content type Drupal ignores the alternate text I enter for any uploaded image. When I edit the content type ...
1
vote
1answer
623 views

Unable to access private file?

I had this issue before, and last time the problem was that node was unpublished. The private file became accessible when the node was published. This time, however, I'm not using a node. I'm just ...
1
vote
1answer
201 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 ...
0
votes
2answers
1k 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
20 views

How to upgrade a site that uses node_gallery for galleries and images?

I have a Drupal 7 site that uses node_gallery to publish several image galleries. This has been working well for several years. I'm looking at upgrading that site to run on Drupal 8 instead. ...
0
votes
0answers
335 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
15 views

Update programmatically (js) the images of a image field in edit form

I have an entity type which has an image field. I use the default form widget for this, and I can upload or delete the image. On the node edit form, I have also a pop-up widget with a javascript app ...
0
votes
0answers
39 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 ...
0
votes
0answers
58 views

Drupal not generate image style for .png

On node edition when i upload new image, like in basic page, all is working with .jpg and .jpeg picture but not with .png. When i upload a new image, the style is well created in 'sites/default/...
0
votes
1answer
33 views

How do I add a customized parameter to image links

Lets say I have image fields in my node. When I get that fields values in the twig it returns the image URL without any issue. file_url(node.field_image.entity.uri.value) But now I want to add a ...
1
vote
0answers
149 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
1answer
278 views

Twig error “Uknown image_style filter”, but the filter isn't missing

I'm migrating a site to a new host. On the front end, I see... Twig_Error_Syntax: Unknown "image_style" filter. in Twig_ExpressionParser->getFilterNodeClass() (line 57 of /var/www/prod/web/themes/...
0
votes
1answer
32 views

Applying image style breaks image src

I have added simple blogging functionality to my Drupal Site using a custom content type named Blog that I created. One of the fields in Blog content type is a image field. Inorder to display a list ...
0
votes
1answer
43 views

Howdo I display all the images from a field in a view?

I'm trying to display multiple images from an image field in one view as an Owl Carousel, but I only see a maximum of 5 images to be displayed there. Googleing it, I found that there's an option ALL, ...
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
84 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?...
2
votes
1answer
233 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
22 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
22 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
42 views

Access image field URL in a custom block [duplicate]

I need to have an easily exposed to user background image in an aera (header). So i made a custom block with an image field and i want to use this picture in a classical <div style="background.... ...
1
vote
0answers
54 views

Alternative methods to creating Image Derivatives

I am importing many many images (300,000+). This number includes adding different crops for each image. I might be wrong, but it seems that to get Drupal to know that a crop style has been set, I ...
0
votes
1answer
66 views

How can I upload an image for a specific image style?

I'm trying to support retina on my site, so I set up a 2x image style and a 2x responsive image style. Now the generated HTML for images looks something like: <img srcset="/sites/default/files/...
-1
votes
2answers
39 views

Dynamic image style?

I need to display profile image, but less blurred each day for example: day 1 : blur 30 day 2 : blur 20 day 3 : blur 10 Image style seems not to be dynamic. And I didn't find a way to do this. ...
0
votes
0answers
123 views

Unable to generate derived image located at public://

I am trying to use a slideshow on my server and I get this error Date Monday, January 28, 2019 - 18:28 User Anonymous (not verified) Location http://mysite.dev.local/sites/default/files/...
1
vote
0answers
505 views

Is anyone working with webp images? [closed]

I'm working on a Drupal 7 site with a prominent flexslider paragraph rotating images. The image files sizes appear to improve quite a bit if I convert them to .webp format. My problem is that I ...
0
votes
0answers
19 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 ...
0
votes
1answer
122 views

Scaling image using Imagick Module

i'm currently using the Imagick module for Drupal 8 and the imagick php extension on the server. Whenever I try to resize images with this tool, using the settings below, I get a really down sampled ...
0
votes
1answer
52 views

How to send mail with multiple images from node using Rules module? [closed]

$language = field_language('node', $node, 'YOUR _FIELD_NAME'); foreach($node->YOUR_FIELD_NAME[$language] as $file) { echo drupal_realpath(file_load($file['fid'])->uri); } I used this code to ...
0
votes
0answers
61 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 '...
2
votes
1answer
526 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
23 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
1answer
1k views

Programmatically update alt tag on image field

I have a Drupal 8 site with a content type that has an image field. For existing nodes of this type, most have image files, but none have alt tags. I am writing an update hook where I want to set ...
2
votes
0answers
356 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. ...
0
votes
2answers
57 views

How to create a sponsors logo block?

I have some experience with Drupal 7, but not that much. Now I'm working on my first Drupal 8 website and stumbled over the following situation: In a first iteration, the website should use the ...
1
vote
1answer
67 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 <...
0
votes
0answers
77 views

How do I return an image from code?

I'm converting some old Drupal 6 code. Some template files for custom content types use code similar to the following. if (some_parameter) { header(/* Set the MIME type for the image type */); ...
2
votes
1answer
258 views

Is it possible to add template suggestions for image styles?

I am experimenting with durpal 8 theme hook suggestions. I tried to customize the the theme suggestions based on the style name. I want the ability to add a twig template for each style if I wanted so ...
1
vote
1answer
39 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 ...
2
votes
1answer
1k views

How do I automatically generate image styles? [duplicate]

How do I automatically generate different image styles in Drupal 8, for existing images? For example, I have about 10K images in field_image field. I would like to generate thumbnails using my ...
5
votes
2answers
2k views

Create styled image programmatically

I have a module that create custom PDF with multiple selected nodes and I use the below function to create the link to styled images: $file = File::load($img_id); $imagesPath[] = ImageStyle::load('...
0
votes
1answer
130 views

Facebook does not use article image

We installed the metatag module, and we activated all metatag entries on the modules administration page. On the module settings we selected content type Node:article and went to Open Graph. We edited ...
2
votes
2answers
934 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
1answer
155 views

How to add title of the image in manage display section or display it in node view page

I want to display title property of an image in node view page. How can I display title of an image along with image in node page?