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

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.

0
votes
1answer
19 views

How to attach media item created during migration to media field in node

I am migrating content from Drupal 7 to Drupal 8. There is an audio field that I am currently moving to media via a custom process during migration. When I get the id of the new media created I can't ...
-2
votes
2answers
31 views

How to get all the entity details which are using specific media?

I have a image "sample.jpg" (In media library). and I used this image in multiple custom blocks of different block types. Now I need the information of all the custom blocks which are using "sample....
0
votes
1answer
19 views

Unset widget tab from media browser programmatically

Need to unset a widget tab from media browser based on the condition of media type supported by the field. Media types: Image and Video. For example, There is a field which references image media ...
0
votes
2answers
31 views

Can I store media files in the private directory?

The normal behavior, described also in Give access to private files to certain role? seem to be the following. Once configured, files stored in the private directory are inaccessible via a direct ...
-1
votes
0answers
23 views

Media plugin error Could not match any bundles to input:

I created my media plugin to use the core media in Drupal 8.4.9 My plugin is to allow user to embed a widget code which will display other areas on my website. On WYSIWYG editor, I click the media ...
1
vote
0answers
13 views

Caption field with default value inside CKEditor

I activated the caption filter under Text format configuration to add description to media inserted via CKEditor Is there a possibility to add a default value to this caption field whenever I add a ...
0
votes
0answers
10 views

Solr Indexing media fields

I have a bespoke media type that I'd like to index with solr. If I add a new field to an existing Media Type, I can add that field to the solr search using the interface found at admin/config/search/...
0
votes
1answer
46 views

'image_style' entity with ID 'media_library' already exists

Recently updated Drupal to 8.7.1 and I am seeing the following error when running database update: www-data@php.container:/var/www/html/web $ drush updb -y The following updates are pending: ...
0
votes
1answer
22 views

Media images link to their own image

I have inherited a site which had no image management. Instead each image field required you to upload an image instead of reuse an existing one. I enabled Media Browser and updated to 8.7. I am also ...
0
votes
0answers
12 views

Setting default upload paths for media

I really want to have an organised files folder in my d8 project. I have two main media fields: field_banner AND field_image They appear in all my content types. I would like that all the the media ...
1
vote
1answer
23 views

How to render image uploaded from a configuration form

I'm working on a custom module, that contains a block and I'm currently having an issue to render an image that is being uploaded through a form at the configuration of the block. I'm getting this ...
1
vote
1answer
15 views

How to change image style using hook_views_pre_render()

I am trying to adapt the following Drupal 7 code to Drupal 8, in order to set a different image style to every image in a view: // Assigns a random style name to each image function <MODULE_NAME&...
-1
votes
0answers
4 views

Put a product image on the tile view of products

I had installed Drupal 7 Ecommerce Kickstart. Whenever I search something, the products list are shown with no cover images shown. I can only see images, when I particularly click the product link. I ...
0
votes
0answers
18 views

How to create product from image

I'm quite desperate right now and pretty newbie with Drupal. Anyhow, I wan't to develop my WordPress site and change this current system to Drupal. So now i'm able to set user specified galleries and ...
0
votes
1answer
28 views

Why cannot I get the path of a video? [closed]

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. This is the code I am using. function slider_get_uri_by_media($media, $style = '...
0
votes
0answers
49 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 ...
0
votes
2answers
22 views

Should I share the same image style as much as possible or create different styles for each size?

I have an image field displayed in slightly different sizes. Let's say : 100px X 100px as a view field format 120px X 120px as another view field format 150px X 150px as a node view format My ...
0
votes
0answers
17 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
32 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
0answers
17 views

How can I get an image form to maintain image order after deleting one?

I have a content type with a field for images. The field accepts multiple images and after I upload several, I re-arrange them to a desired order. After re-arranging them, I can enable "Show Row ...
0
votes
1answer
24 views

RewriteBase /folder issues on IIS for broken images

I have a Drupal 7 site hosted under a subdirectory say http://example.com/drupal. I am using IIS and SQLSRV. But all the images could not be loaded on the site as these images pointing to http://...
0
votes
1answer
33 views

Show full image path D8

I have set a Drupal 8 project into another server with some child directory. This D8 project is working good, But images are not showing due to path missing. E.g My project is setup:- http://abc.xyz....
0
votes
2answers
35 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
25 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
26 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
52 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
15 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
38 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
40 views

Output image src via JSON

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
227 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
176 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
290 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
18 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
103 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
13 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
23 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
52 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
32 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
66 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
96 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
31 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
35 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
75 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
67 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
19 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
16 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
19 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.... ...