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).

Filter by
Sorted by
Tagged with
0
votes
2answers
63 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 ...
0
votes
1answer
72 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
94 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
332 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
48 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 ...
4
votes
1answer
2k 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 ...
6
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
201 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
2k 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
224 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?
0
votes
1answer
162 views

create new image style using javascript

I am using fancybox JS library for creating a slideshow from a custom bloc with a multivalue image field. it works but the images on the slideshow are small because a style have been applied to the ...
-1
votes
1answer
54 views

Image style not generated for specific content type in amazon s3

I have store images/files in amazon s3 using s3fs module when I upload images/files it stores in default public files on s3 server like s3fs-public folder . But I want to store images/files on ...
1
vote
0answers
1k views

How to add image field in a custom module form?

In our custom module, mymodule we have a form MyModuleForm where we want to allow for an image to be uploaded or chosen from already uploaded images. Below is the MyModuleForm.php file, but cannot ...
2
votes
1answer
511 views

Different responsive image per breakpoint

I have the following scenario - the main page banner should have at any time 1 of 3 images displayed at a given viewport size. These images are art-directed, that is to say, that will differ in ...
0
votes
1answer
53 views

Passing Image through hook

Background: Im working in Drupal 8 and I have a paragraph type that contains a title and an image and I am trying to pass it through the preprocessor hook so I can set it inside a html template. For ...
0
votes
0answers
58 views

How do I crop an image without cutting off parts?

I'm using Image Crop Widget (8.x-2.2) and Crop API (8.x-1.5). I'm trying to add "padding" to the cropping area so that I wouldn't have to cut my images at awkward places. In the above picture, I have ...
-4
votes
1answer
44 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
81 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 ...
3
votes
1answer
2k 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
214 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
2answers
30 views

Views image field

I'm trying to add inline styling to my Drupal image using the image field under view. No matter what method I try, nothing is working. I've run out of options. Any help? Below are a few code ...
0
votes
1answer
220 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
1answer
21 views

How to add a profile cover with a user field image in a view? [closed]

I am trying to add a cover image to user profiles in a block view, the image comes from a user profile field. The problem is that I need the path to that image because my neede code is like this: &...
1
vote
1answer
670 views

How can I disable image resizing in CKEditor?

Our site is responsive and when editors use the resizing handles after uploading an image into the editor, it puts in fixed width and height on the image. We don't want them resizing images at all, ...
0
votes
1answer
311 views

How to add a title text input to an image field node form widget

If you have an image field widget in a Drupal node form you can automatically edit the image alt text in there, but is it also possible to add a title text field? When I install the File Entity ...
0
votes
1answer
74 views

Print image from filepath in Twig

I have a paragraph with an image field. If the image field is empty, I want to display a default value. I do not want to just set the default image because an editor could remove that. Here is my code ...
0
votes
1answer
39 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 ...
0
votes
1answer
101 views

How do I bulk update the alt and title tags of images

Is there a way to bulk update image title and alt tags? Where do alt and title tags are saved in the database?
3
votes
0answers
3k 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
82 views

Add a default value for existing Image alt field

I have an image field in article content type and have created hundreds of nodes for article content type, but now I need to add a value for image alt fields for these existing nodes. Even the default ...
0
votes
1answer
240 views

Add fields to image upload option in CKEditor

I make SVGs using LaTeX and would like to upload both the image and its LaTeX source code when I attach an imagine via CKEditor. I don't want the code to be displayed, just stored with the image so ...
-1
votes
1answer
74 views

Two step media creation form? [closed]

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 ...
0
votes
2answers
423 views

Image Styles Not Generating Thumbnails/Previews

I have File Browser installed on my website. The module info can be found here: https://www.drupal.org/project/file_browser When I go to browse for pictures, there are no images. You can see what I ...
0
votes
1answer
229 views

Webform image select element is dispalying another image while used in webform handler

In drupal 8, I have created a custom webform handler to create a new article node and copy the data and images from the webform element to the created article node. In both artcle node and contact ...
2
votes
0answers
391 views

How do I migrate images and image data?

I used the Drupal migration module (browser) to migrate a Drupal 7 site to Drupal 8. Even though I had to restart the migration a few times, it migrated all the users and the nodes. I can't figure ...
1
vote
0answers
661 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 ...
1
vote
0answers
355 views

How to migrate images?

I'm trying to import images, but why does migrate_tools swear on my yml file when I try to migrate. id: migrate__articles_teaser_images1 label: 'Migration teaser images of article' migration_tags: ...
0
votes
1answer
104 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-...
3
votes
1answer
647 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 ...
0
votes
1answer
118 views

How to associate the last image from gallery to user's profile picture

In Drupal 7 (Commons 7.x-3.46). I've created a new content type, by which each user can upload images and build a personal picture-gallery. How can I now associate the last-uploaded-image to the ...
1
vote
0answers
309 views

Get image url with https instead of http

When I use file_create_url it return url with http instead of https. Code Snippet: $desimg = file_create_url($node->field_image->entity->getFileUri()); Due to which i m getting warning ...
1
vote
1answer
958 views

Save and set an external link image programatically

I have a field that will accept an image link coming from the external source. But of course, to set that image I have to save it in Drupal first. I'm wondering how do Drupal save the image from an ...
0
votes
1answer
663 views

Cannot insert images in body of a basic page

I am using CKEditor and WYSIWYG. After updating Drupal core to 8.5.6, I cannot upload an image using the CKEditor's 'image' button anymore saying "Image Field is required." I have checked CKEditor's ...
0
votes
1answer
330 views

How can I access the raw value of a view in a template?

I am looking for a way to get the url of an image dynamically to put it as a background. So I created a view that get the image field of the node or taxonomy term, which is supposed to output the url ...
0
votes
1answer
205 views

Image widget crop not returning multiple derivatives in JSON API

I'm using below modules for image crop https://www.drupal.org/project/image_widget_crop https://www.drupal.org/project/cloudinary https://www.drupal.org/project/consumers https://www.drupal.org/...
0
votes
1answer
30 views

User Created Slideshow

I am new to Drupal and I'm looking for a slideshow of user uploaded images on a user uploaded project. Basically, I want the user uploaded images to be shown on the content page, in addition to text, ...
-1
votes
1answer
143 views

Link image to new tab [closed]

I have a problem trying to link image teaser to open in a new tab when clicked. How do i go about that? I know in html is target="_blank" attribute.
1
vote
1answer
140 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 ...
-2
votes
2answers
202 views

How do I upload a background image?

I want to insert a background image in the IBM API Connect theme. I first googled, and I found how to insert an image in a node; then I downloaded the Background Images, the Background Images ...
1
vote
2answers
2k 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 2 3 4 5 53