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
2answers
627 views

Responsive background image in Twig template

I would like to render an image as background image in my Twig template. To optimize my resources I'd like to use a responsive image but I cannot find a way to use it for background images. For a ...
0
votes
0answers
73 views

Delete original image after uploading and generating image styles

I need to delete the original image file after it has been used as source for generating the defined image styles. I'm fine with the generated images and want to delete the original because of space ...
0
votes
1answer
533 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
182 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
365 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&...
3
votes
1answer
1k views

How can I allow users to specify image dimensions in CKEditor

I have a use case where content editors have a requirement to specify the height and the width of an image in the image properties. Sticking to styles is not possible because $reasons. The CKEditor ...
1
vote
1answer
27 views

Unable to fetch image after using Content Import and IMCE module

I am trying to import content for custom content type fields using csv, in content I have images fields as well and using the Content Import Module for CSV import and IMCE module for image upload. ...
0
votes
1answer
170 views

How to wrap body text around image for drupal 8

How to wrap body text around image for drupal 8. I found tutorial for drupal 7 here https://www.drupal.org/forum/support/post-installation/2008-06-30/how-to-wrap-body-text-around-image, but I still ...
3
votes
2answers
2k 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
1answer
23 views

Layout problems (backgrounds and blocks region)

I'm a non professionist dealing with drupal for the first time and it's killing me. I'm trying to create a page without having to code but it seems impossible! I need to adjust the position of the ...
0
votes
0answers
24 views

Images and styling not rendered correctly on page refresh

The problem is that images and some styles are not correctly rendered when I hit Cmd+R and doing a refresh, but it is working fine on a reload. So my question is not what the difference between a ...
0
votes
1answer
94 views

how to attach existing images(image field) to node in drupal 7?

I use the following code to upload images $node = node_load($nid); $file = (object) array( 'uid' => $v['uid'],//@todo from query 'uri' => 'public://'.$v['filename'],//@todo from query '...
0
votes
0answers
54 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
2answers
575 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 ...
1
vote
1answer
107 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....
0
votes
1answer
47 views

Using background images formatter for taxonomy in views

I have an image field per taxonomy vocabulary that I want to set as background to each views-row. I have the view filtered by taxonomy term, and I have set the taxonomy_image field as background. ...
0
votes
1answer
19 views

Uploaded images classified as files rather than under the media tab

In Drupal 8 if you go to admin/content there is a tab for Files and a tab for media. I believe it is the media entity browser what distinguishes what area an uploaded file will be placed, but I could ...
0
votes
1answer
75 views

Add paragraph domains to media View

I'm using media and domain modules. Nodes are assigned to multiple domains and there are image fields that link to media images on those nodes. Some content types also use paragraphs and these ...
0
votes
2answers
26 views

Specific css change not permanent [closed]

I'm running a site using Drupal 7.32 on Apache 2.4.10 (Debian). I have a peculiar situation where if I write some text on some page and upload some document to be linked by text, everything goes fine; ...
0
votes
1answer
37 views

Apply conditionally an image style on an User Profile page

At the moment the module “Image Styles Rules” is only available for drupal 7, is there another way to apply conditionally an image style depending on the aspect ratio of the image (portrait or ...
0
votes
0answers
42 views

How to implement custom Bueditor button for uploading image files

Currently, you can only insert image files with BUEditor module like shown on the picture: On a Drupal 7 website with file field enabled to upload images I am looking for ways to integrate both. The ...
0
votes
1answer
412 views

How to apply Image Style with no effects and lazy load image?

We have two content types (Articles and Basic Page) that use the same Image (field_image) field. We are using the lazysizes js library where you need to add class="lazyload" and data-src="image-url....
1
vote
1answer
54 views

How to fire a Rule when an image is removed from Image field with unlimited values?

Working with Drupal 7.58 and File Entity 2.19 and Rules 2.10 First I needed to fire a rule when saving a new file and I found a solution (here). Now I would like to fire a rule when an user removes ...
0
votes
1answer
436 views

How come images with image styles are blurry?

We have noticed that images that are displayed using Image Styles are blurry. Below are the settings we have enabled. The original images look fine and scale accordingly when using those on the ...
0
votes
1answer
385 views

How do I change the uploading image file name

How do I change the image name while uploading through a file uploading field? In drupal 8 whenever I add an image to a file field, it automatically uploads the image file to my S3 bucket. I need to ...
0
votes
2answers
590 views

Dynamically changing the href on a link with data-dialog-type = modal does not work

For reference I am working on this issue for the Focal Point module... I have a link whose href is updated dynamically using js based on a particular user interaction (moving the focal point on an ...
0
votes
1answer
941 views

drush updb fails with “the 'media_delete_action' plugin does not exist” after 8.4.6 > 8.5.1 update

We have recently updated a Drupal 8.4.6 installation via composer to Drupal 8.5.1. After the composer update I ran drush updb as usual. However, the command fails at one point with the following ...
1
vote
1answer
226 views

Are there alternatives to using URL to Image Formatter?

We had a need to set an image as a background element for a <div> tag (see example below). When we tried to the following (with Image as formatter) it only returned the original image url, not ...
0
votes
1answer
37 views

How to change the path in which are stored the media modules files and images?

When using media entity reference fields, is it possible to change the path where are stored the files and how? Is it possible to store them in the private folder?
2
votes
1answer
1k views

Getting the media URL in a views field

I'm using Drupal 8.5. I have a content type with the in-core media module. I'm making a view for content syndication, and I need one of the columns to be the FDQN URI to the media resource-- i.e, not ...
1
vote
1answer
57 views

Starting new 8.5 site is it safe to delete and reuse field_image field

I am starting a new 8.5 website and using the core media module. I want to know if it is safe to delete the field_image field from the Article content type and replace it with a field with the same ...
0
votes
1answer
262 views

How to override thumbnail generation of file type media?

In admin/content/media I need to show file type related icons instead of generic file icon. From this: To this: I tried to edit the related thumbnail field in "media" view but no option is present. ...
0
votes
1answer
54 views

Fancy insert stopped working

Does anyone have an issue with the fancy insert module, not actually inserting the image on click recently? It looks like the javascript in the fancy insert was hooking into the insert button by ...
0
votes
2answers
51 views

How to re-upload an image but not removing it

I have an image field which has 1 value limited. I need to change the uploading photos frequently, and I hope the old images will not be removed. Is it possible to achieve this?
1
vote
1answer
1k views

programmatically attaching file to file media

I am trying to programmatically attach a file to a node, using the media module now included in core as of Drupal 8.5.0. I wrote this drush script to stub out the creation of a new file media ...
0
votes
1answer
603 views

403 forbidden error when loading images in test server

Am working with drupal7.When images are loading below error is showing in my test site console: GET sites/default/files/styles/slideshow_full/public/plans/30989/main-image/...
0
votes
1answer
386 views

Theming image.html.twig

What name do I have to give to my image.html.twig so the template only being used in content type "project" because I need to add class to an <img> tag. I already tried image--node--field-...
1
vote
2answers
147 views

how to give relative path in drupal for setting an image

Hi all, iam trying to set image here in a module .The image is in the same module folder. but iam not able to get the image path <td><img src="projectsetup.jpg " width="42" height="...
0
votes
0answers
50 views

How to set the image as a background using Url to Image formatter? [duplicate]

We have a need to set an element such as <div> to have an image as a background. I am trying to figure out the way to get the image to display as a background but also with the image style that ...
0
votes
2answers
65 views

How to apply Image Styles to images that have been added to published nodes?

We have an image field (field_image) that did not have an image style originally applied. In the end we have hundreds of nodes (pages) where the Image style is not present. When adding an image style ...
1
vote
1answer
645 views

Migrate media with alternative text

I'm trying to import image with new media module on core 8.5. I've a json source and on my .yml I've: field_media_image: target_id: plugin: migration migration: immagini ...
0
votes
1answer
136 views

PDF Preview module not working in ubuntu for Drupal 8.5 version

PDF Preview module not creating the image(first page of PDF) in docker (Ubuntu) for Drupal 8.5 version. I have installed imagick(configured the exce path in imagetoolkit module) and Ghostscript and ...
0
votes
1answer
57 views

Custom Gallery images showing in one column

In Drupal 7, I have created a custom gallery, but all images are showing in only one column. I have Bootstrap theme for Drupal. I'm using the modules Views (Bootstrap), Colorbox, Multiupload ...
1
vote
1answer
568 views

8.4 - Use entity browser in a module block from in same way as I would in a custom block

I am having trouble adding an image picker to a block form defined in a custom module. If I create a custom block type I can define an image field as entity_reference and in the block's form view ...
0
votes
2answers
97 views

Fuzzy image display on new content type

I'm having issues on our Drupal 7 site. We have created a new content type that includes a hero image. The problem is that full sized images that we upload aren't displayed on the page (despite ...
0
votes
1answer
279 views

How to hide the label of a entity referenced image field

I am using drupal core 8.4.2 and lightning 8.x-2.23. I have a entity referenced image field that I am printing out like this {{ content.field_main_image_2.0 }}. I think there was a change starting in ...
0
votes
1answer
373 views

Image styles are not created 404 Not Found

I'm running on Nginx. All permissions are set to 777 and owner is www-data:www-data. Create/edit a node with image_field, upload an image. Original image is uploaded and stored at sites/default/files/...
1
vote
0answers
417 views

Image styles not generating when an unrelated htaccess rule is active

Having a very bizarre problem on Drupal 8.4.4. I have a custom module which accepts an image through a POST request and saves it as the submitting user's profile picture. This module has been in ...
1
vote
1answer
81 views

Drupal user profile image alt text is showing special characters

Drupal user profile image alt text is showing special characters instead of a quote in the user name. My user name is Derek O'Rourke and the alt text for user profile image is showing Derek O&#...
0
votes
2answers
707 views

One image style not generated

UPDATE: After investigting this I have concluded that the problem concerns ALL new image styles, but "old" ones are still working. Old ones are the built-in (e.g. thumbnail) and one image style of my ...