Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I upload images using the Media toolbar button (CKEditor) I get options to format the image - a drop down with options Link, Preview, Large and Original. Where are these defined? Are they related to the Media module -> Image Styles options? If I change setting in Image Styles I don't see anything reflected here. How can I change these formats? Thanks.
Comments
Comment #1
TwoDYes, I think the button/dialog you are referring to are controlled by Media module.
Moving to their queue. Please change the version if my guess is incorrect.
Comment #2
mattcooper CreditAttribution: mattcooper commentedAnyone got any thoughts on this?
The seemingly simple objective of having a user friendly image uploader for a rich text field seems impossible at the moment, how does everyone else do it?
Comment #3
vefverksmidja CreditAttribution: vefverksmidja commentedI have added this feature into media because I wanted to be able to choose from the image styles when formatting the image (adding into body) in CKEditor
in media/includes folder find the
media.filter.inc
in the media format form there you will find a foreach ($view_modes as $view_mode => $view_mode_info) {
What I did was put before it an if condition checking if the file type was image or not if it was image then I wen to the else
So the end result looks like this
Hope this helps someone to be able to use this or take it step further and make it better.
Comment #4
tsvenson CreditAttribution: tsvenson commentedClosing due to no activity for a long time. Feel free to reopen with updated info if issue still remains.
Comment #5
Jboo CreditAttribution: Jboo commentedI've used the code to alter the media.filter.inc file and the new styles appear as suggested. However, I have a couple of issues...
I have these errors:
Also, the image appears correctly in preview, however only the media module default image appears when viewing the node and not the image that's been uploaded.
Could anyone point out why I'm getting the error and issue?
Thanks for any help.
Comment #6
Devin Carlson CreditAttribution: Devin Carlson commentedThe format form allows you to select which view mode the file being embedded is displayed with. This is by design. If you want to present users with a variety of image sizes to choose from, create new file view modes using Entity view modes or Display Suite and assign them the image formatter with different image styles applied.