Questions tagged [media]

Drupal core has some modules to handle images and other media files, for example the Image module and the Media module.

Filter by
Sorted by
Tagged with
3 votes
2 answers
645 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 ...
4 votes
3 answers
845 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
2 answers
1k 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('...
0 votes
1 answer
412 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 ...
0 votes
1 answer
721 views

External URL Redirect Breaking Image Links

I was recently hired to manage an existing Drupal 7 site (built with an Omega subtheme) and am doing my best to ramp up quickly. Unfortunately, I do have some fires to put out immediately and could ...
1 vote
3 answers
991 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 ...
0 votes
2 answers
615 views

Default user image in user account menu!

I am trying to add a default image to render in the user account menu when the user does not have an image. CODE: function nestle_preprocess_menu(&$variables) { if($variables['menu_name'] == "...
1 vote
2 answers
822 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
2 answers
450 views

Embedded images are not working in CKEditor 5

While migrating CKEditor 4 to 5, images added through entity embed ( E ) option in CKEditor 4 is not appearing after switching to CKEditor 5. Any idea how to make it work in CKEditor 5? in CKEditor 4 ...
1 vote
2 answers
2k views

How can I use function template_preprocess_field() to pass a value from one field to an attribute of another field?

I have an Entity Product entity where one of the fields is: reference field on Media type with name Media Product Image Media Product Image has fields: Image Custom color id And in the developers ...
0 votes
1 answer
690 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 ...
1 vote
1 answer
591 views

Entity Reference Image not rendered

I have a content type with an Entity Reference field. The field references multiple images. Using Display Suite, I can set the display format to "entity id" and when I view the content, I get a list ...
0 votes
1 answer
585 views

Get file ID and path to use in a template file

I am working in my Row style template (views-view-fields--MYVIEW--block-1.tpl.php). I need to get the file ID and path of an image. The image field is a multi field, so I need to get all of the images ...
0 votes
1 answer
524 views

Is it possible to change the _alt_ text wording for images in one place?

Is it possible to change the alt text wording for images in one place, as the wording used does not pass validation? The website contains a vast amount of pages, most of which with images having ...
1 vote
2 answers
2k 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 ...
1 vote
1 answer
1k views

Configure inline images upload path per content type

There is a core feature that lets you configure where to save inline images uploaded using CKEditor: Here you can specify the path where you want store inline images. But this is global ...
0 votes
0 answers
23 views

Different alt-text per node for media entity image

Is there a known solution for beeing able to change the alt text of an image (From the media module) on a node level. So I have one image in my image library. I have two nodes. Node 1: About me, ...
0 votes
0 answers
42 views

Change Bundle Type for Media Entity

By a mistake, a lot of videos were created as documents instead of videos. I want to avoid copy them into new entities because of the usage of the existing entities. I tried something like the below ...
2 votes
3 answers
399 views

Hide default value by view mode

I have an image field inside the content type 'Article'. I have two view mode: "teaser" and "full". I have a view page ('Homepage') showing all 'Article' nodes using "teaser" view mode. In the '...
0 votes
0 answers
75 views

How do I get <drupal-media> to appear?

I am trying to use the Drupal Media insert button in the CKEditor5 module. (Important - the existing images were included using CKEditor4 and are inline images, not using Drupal Media.) I upload the ...
0 votes
1 answer
789 views

View to display content type and media type

Drupal 8 Say I have 1 content type and 2 media types users can create Content type: Post Media Type: Picture Media type: Movie How can I create a view that pulls all 3? As far as I can see you can ...
2 votes
1 answer
2k 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 "...
1 vote
1 answer
767 views

Creating nodes from json including image field upload

I am trying to create a node programmatically from the data(JSON) sent by my front-end template. <input id="title" name="title" type="text" > <input id="body" name="body" type="text"> <...
0 votes
1 answer
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 ...
3 votes
2 answers
869 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
3 answers
7k views

The uploaded file likely exceeded the maximum file size (32 MB) that this server supports on remove image

In my taxonomy terms,when I try to edit a term I got this error : An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (32 MB) that this server supports. ...
0 votes
1 answer
491 views

Image Styles not creating on one custom style only

I've run into this issue where we have created a custom style (emailthumb) which is to be used when sending out email newsletters via simplenews. The thumbnail is based on 'thumbnail' style but is ...
1 vote
1 answer
671 views

How to change image size and position when uploading to article in tb_rave_starter

I want to change image size and position How could this be done, please help me.
4 votes
2 answers
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
2 answers
727 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
1 answer
1k 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 ...
2 votes
1 answer
851 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 ...
1 vote
1 answer
801 views

How to execute ajax action after image file upload with media widget?

I want to prepopulate some node fields with image metadata (using the EXIF module) right after an image is uploaded/inserted in a node image field with media browser widget and before the node is ...
10 votes
3 answers
11k views

Programmatically create media file

I'm trying to programmatically create a media file. Here's what I got so far: $file_data = file_get_contents('http://www.africau.edu/images/default/sample.pdf'); $file = file_save_data($file_data, '...
1 vote
1 answer
641 views

How to get file uri from entity video

I have some code to get video using view builder. $view_builder = \Drupal::entityTypeManager()->getViewBuilder('media'); $storage = \Drupal::entityTypeManager()->getStorage('media'); $entity_id =...
0 votes
1 answer
1k 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(...
0 votes
1 answer
530 views

Preview is not showing after upload

When i am trying to upload image as a Authenticate user, After upload i am not able to see preview. fields got disappear fully. If i try to do as a admin, i am able to see that. Any suggestions?
2 votes
4 answers
810 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 ...
0 votes
1 answer
41 views

I can't create new fields of type image

Drupal v10.2+ has that new shiny admin UI for creating new fields. However, that new shiny page does not allow the creation of new image fields (the non-reuseable image files, NOT the reuseable media ...
0 votes
1 answer
408 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 ...
0 votes
2 answers
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 ...
0 votes
2 answers
560 views

embed photo album hosted on flickr.com using flickr module not showing photo album

I am attempting to use the Flickr module flickr-8.x-1.0-alpha2 along with Flickr API and Colorbox module to display a album of recent photos from Flickr.com. I have setup the API keys. and added ...
0 votes
3 answers
1k 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 ...
1 vote
1 answer
435 views

Selecting image for embedded youtube video

Would like to know how to select the image that is shown on the web page for an embedded youtube video. Currently an image from the video seems to be randomly pulled out and used.
0 votes
1 answer
386 views

Change default tab for Media browser

Is it possible to change the default tab for Media browser (Media module) in Drupal 7? Currently I have: Upload, Web, Library and My Files. I would like to open Library by default, instead of Upload....
4 votes
4 answers
6k views

How can I render a responsive image style from an image in the theme directory?

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 ...
0 votes
1 answer
2k 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 ...
3 votes
2 answers
465 views

Field in Custom Content Type Stripping out <img> tags

Drupal6: I have a custom content type, with a custom field, set to textarea. The content type's instance filter is set to Full HTML. When I add an image tag to the custom field, the image renders in ...
2 votes
2 answers
986 views

Show custom banner per page

Admin user wants to be able to upload image banners and select on which pages/nodes/views/panels to show it when visited (as a wide screen image banner above title). It means when creating the banner ...
0 votes
1 answer
382 views

Programmtically add image to custom image field User

I can't figure out how to add image to a custom image field on a sepcific user. $f = file_save_data($user['thumbnailphoto'][0], 'private://profile/'. $data['name'] .'.jpg', FILE_EXISTS_REPLACE); ...

1
2 3 4 5
56