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
1
vote
2answers
628 views

Hide Alt and Title for image field

How to hide Alt and Title fields for anonymus users when they upload images? I use tokens for these field that's why I need to hide them.
0
votes
3answers
477 views

How do you wrap an image with a link?

In Drupal 7 this was done with the l() command and setting the html option to true. I have found the Link::fromTextAndUrl() method in Drupal 8 but no mention of something similar to the html option. [...
4
votes
5answers
4k views

Image thumbnail styles are not created

I'm moving a website in a production server and it appears that the image thumbnails aren't created from an Image Field in a content. The images are uploaded correctly but no files are created in ...
0
votes
1answer
43 views

Custom remote video thumbnail

I'm using the media entity from Drupal core together with the media library, to handle media on my site. I have Remote Video and Image with crop media types. I'm using the crop and image_widget_crop ...
1
vote
1answer
367 views

Uploaded file not shown in custom content type / Image not attached to content type

In Drupal 7, I am trying to upload an image that belongs to a custom type. I click the Browse button, choose the file and upload. Until there, all seems to work well. However, when I click next, ...
3
votes
2answers
611 views

Problem with image width in views/ block

I have a problem to set image dimension on various position. I want a 300x100px in top, 100x75px for thumbnail and other dimensions on other place. In WordPress I can just add "width" attribute to set ...
0
votes
1answer
608 views

Need to center images in wyswyg block

I am trying to center 3 images in a block I have created in my footer but the images just won't center. I tried the wysiwyg editor's center button, but that did not work. I then tried to put in manual ...
0
votes
0answers
15 views

Unable to alter OEmbed remote video providers

I'm trying to add a remote video provider for OEmbed. I'm using the hook_media_source_info_alter to change the OEmbedDeriver class like this: use .../CustomOEmbedDeriver; /** * Implements ...
0
votes
0answers
17 views

Can't edit media Image from within node edit

I'm using Media and the Media Library (yes I know this is experimental). And all of the sudden I'm not able to edit my added image when I'm editing a node. In an earlier stage of the website I was ...
0
votes
1answer
5k views

Best way to use image styles with Media and WYSIWYG?

Up to now, I've been using the Insert + WYSIWYG + CKEditor to insert images with specific Image Styles in a wysiwyg interface. This works well, and it's very easy to select and apply image styles (...
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 ...
2
votes
1answer
2k views

How to rename uploaded files

Using Drupal 8, I want to rename and clean all filenames, e.g. If someone uploads file named like this Screen Shot 2016-03-29 at 1.13.21 PM.jpg, I want to clean it so that convert all spaces to dashes ...
0
votes
0answers
14 views

Entity:media doesn't exist error when searching for url in “add link” in wysiwyg

When adding a link into a rich text field (wysiwyg) (see images bellow) and searching for a keyword the throbber icon keeps spinning and that's it. I looked at the error logs and found the following, ...
0
votes
1answer
2k views

Node Gallery Lightbox

I am using Node Gallery Module, just want to know if there is a way we can open the images in Lightbox or Colorbox? I know this can be done in Media Gallery module but can not find any way in Node ...
1
vote
2answers
1k views

How to add image field to module install file

How to add image field to database in module install file? I found on api documentation, that type is image, so tried the following code: function profile_bg_schema() { $schema = array(); $schema['...
0
votes
2answers
768 views

Add cropping option to an image form

I've the next form. $form['imagen'] = array( '#title' => t('Image'), '#type' => 'managed_file', '#upload_validators' => array('file_validate_extensions' => array('...
2
votes
4answers
773 views

Media module and views. Cannot make video image linked to node

Using drupal 7.20, Media 7.x-2.0-unstable7, Media Youtube 7.x-2.0-rc2, File Entity 7.x-2.0-unstable7, Entity View Modes latest version. Created new content type called "video", added video field type ...
2
votes
2answers
724 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 ...
1
vote
2answers
1k views

“File (Field) Paths” and “Media” modules: files not saved in the intended folder

I'm trying to use both the "Media" module (1.4) (to manage uploaded files) and the "File (Field) Paths" (to keep the uploaded files organized in various subfolders). Basically, I have a content type ...
4
votes
2answers
3k views

Using Media, views, and colorbox to create a image gallery

Currently I am running in D7 with the following modules: Media 7.x-2.0 Views 7.x-3.7 Colorbox 7.x-2.4 I am trying to create an image gallery using these modules with the following steps. Please ...
3
votes
2answers
854 views

How to use the gallery formatter settings in a display suite code field?

I am using the gallery formatter module to format photo galleries. To satisfy a requirement I need to create a Display Suite code field that displays the list of pictures attached to a related node (...
1
vote
3answers
979 views

How to make galleries relative to particular nodes?

I have a site with news and I want to make it possible for admin to add image gallery to Articles (nodes) the admin wants. So, the idea is to make gallery image field for every content type from which ...
2
votes
1answer
845 views

How do I integrate media (e.g. attaching audio) to nodes?

I installed the Media Entity module for Drupal 8. I thought it would somehow facilitate adding Mp3, etc, as Media does in Drupal 7, where I could specify a media player type for an audio file. (And ...
0
votes
1answer
1k views

Duplicate entry/Contraint violation 1062 in file_managed on browser crash

I'm using Drupal 7.28. Today when I tried to upload some 100 image files in Image field type, it aborted in the middle saying that "20 MB" limit reached. Now it wouldn't even show me way to delete the ...
4
votes
3answers
827 views

User contributed image gallery, per node

Working on a new Drupal 7 based site. Put together a few sites back in the 5 days, but lots has changed. I'm looking to allow users to upload images to a particular content type, and to show those ...
0
votes
2answers
821 views

Base path and user picture uploading

So I recently migrated my site between servers. I think this is causing some issue with the base path of Drupal, which in turn affects the image upload path when a user tries to upload an image to his/...
7
votes
3answers
16k views

Rendering an image field in page.html.twig with a custom image style

I'm trying to set up a slideshow that's unique to each page. The code for this needs to be in page.html.twig. I've got the slideshow mostly working, but I can only call the full image URL, not a ...
0
votes
1answer
58 views

Rendering a responsive image style in Twig

I am working on template views-view-fields--myview.html.twig. But I do not think it matters what template you are working with for this to work. I found this Twig that can add Drupal responsive ...
22
votes
3answers
45k views

Get path to theme assets in Twig template

I have a question about getting a path to an image in a Twig template. The image is not assigned to a field or something. Just a static image which is stored in "MYTHEME/image/icon/my-icon.png". In ...
1
vote
2answers
646 views

How to use an image with Responsive Image style as a background?

We have a need to use the Responsive Image module. The key is that we want to be able to use the image (field_image) field with Responsive Image styles as a background and put the node's title on top ...
0
votes
2answers
107 views

styles unlimited value image fields

I use unlimited values for image field in a content type, then the images displays one below the other : Is there a way to render this field differently? For example every line show me only three ...
4
votes
2answers
1k views

Upload file and fill in fields in one step; or trigger a rule when a file is uploaded

I want to make use of the Media module and the File entity module to upload files, in particular images, to my site without having to attach them to a node. Solely uploading images works like a charm, ...
0
votes
0answers
41 views

User picture in teaser

I've added this code to show user picture under own post and it works perfectly but when i logged out , i cant see user picture !!?? <div class="user-pic"> <?php $...
0
votes
2answers
711 views

View with content from Media gallery links to node not working

So i have a couple of nodes I made with the media gallery module. Then made a view called 'most recent photoalbums' with I put inside a block to be displayed on the frontpage. The problem is that ...
2
votes
1answer
1k views

Image preview thumbnail does not display

Drupal 7. When adding a core image field to a content type to display an image, the preview thumbnail does not display on the edit page when uploading an image. What appears after clicking on the "...
2
votes
1answer
2k views

Display Auto Generated Youtube Thumbnails with 'Video Embed Field' Module in Views

I added some videos to my site and I'm using views to display them. I followed a tutorial and i used the rewrite the output option of the view with allowed replacement patterns to display videos in ...
0
votes
0answers
14 views

Media field permissions

I have a certain use case. I have an entity that has a "media" reference field. I want users to be able to add/edit/delete media entities without giving them Edit any media or Delete any media ...
0
votes
1answer
2k views

Import nodes with images

Im trying to create nodes from CSV also with image in one image field. I'm using Migrate modul in Drupal 8 and Migrate from CSV. Data to node works fine, image download and copy works fine but in node ...
0
votes
2answers
4k views

get file path of image style as replacement patterns in views

i need something like <img attribute1='value' src='sites/default/files/styles/thumbnails/**pic_0**.jpg'> in views. i have to use rewrite result because i need attribute1. but i have no idea ...
4
votes
1answer
676 views

Image field upload shows a broken preview until I reload the page

When I upload an image it does an AJAX upload and then tries to show the thumbnail but the thumbnail style of that image is not available, so it shows up as a missing image. If I save and come back to ...
5
votes
2answers
3k views

Media with WYSIWYG not converting media tags to markup

I just installed the Media module v 7.x-2.0-alpha3 along with WYSIWYG, CKEditor, and Image Resize Filter. (The site has many other modules active.) The site also uses Display Suite, and its view ...
0
votes
1answer
350 views

How to make uploaded file permanent to node without node submit

My module automatically save new empty node when user create new node and redirect to edit this node. Now, is it possible to make uploaded file on _node_edit form without submitting form? edit: When ...
0
votes
0answers
44 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
15 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 ...
8
votes
5answers
19k views

Adding a Image Upload Button in CKEditor

I have installed CKEditor in Wysiwyg profiles. While publishing any node if i click on the image upload button it shows options to add images by a image link, but what is the way to add a dynamic ...
5
votes
7answers
5k views

Image styles do not work

I am struggling to find a solution for image styles not getting generated. The original pictures get uploaded to the server but no styles or thumbnails are generated. I have checked folder ...
0
votes
2answers
842 views

How to alter image style based on product custom attribute?

I'm building a webshop based on Ubercart, and products have a custom attribute "sold out". When this attribute is checked, all product images should be displayed with a semitransparent overlay textbox:...
0
votes
1answer
896 views

Display youtube video using Media Oembed in the node

I have embedded youtube video in an article using media+media_oembed+media_internet modules.Media(my field) is a field collection item with two fields - media and caption field.I have custom themed(...
2
votes
1answer
725 views

Imagecache_external: Thumbnails of external URLs aren't accessible

Modules: Imagecache External, Media, Remote Stream Wrapper Scenario: I created a content type, in which I want to collect Movie Actors. My aim is to add images of those actors which arent hosted on ...
3
votes
0answers
213 views

How can I convert an existing 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 ...