I am using media 7.x-2.0-alpha3, file entity 7.x-2.0-alpha 3 and display suite 7.x-2.6.

What I would like to do is control the display of a Rendered [jpg] File using an Image style. When I Manage the Display of my content type, I choose "Rendered File" as the Formater. This allows me to select a View Mode, but Image is not one of the options that is available. I have gone to Structure->File Types->Image->Manage File Display and set the parameters that I would like there, but those settings are not being applied when I view the Rendered File.

Node 40229/how-to-set-media-styles-in-media-7-1-2-media-7-2-x says the following:

"Formatters can be enabled and configured for each view mode enabled in their file type's "Manage Display" section. For example, a user may want to display a Media: Vimeo preview image when a node is viewed as a teaser, the Vimeo video when the full node is viewed, and a video with different width and height formatter settings when the node is viewed with a custom view mode called "video gallery". Many formatters (notably "Image") allow the user to select the image styles they have defined in Configuration -> Image Styles."

That last [bolded] sentence is what I'm trying to do, but cannot.

I don't know if it matters, but I am displaying the image in a panel [version 7.x-3.4+2-dev]

Any suggestions gratefully received.

Comments

wdseelig’s picture

Issue summary: View changes
Devin Carlson’s picture

Project: D7 Media » File Entity (fieldable files)
Component: File Entity » User interface
Status: Active » Fixed
Issue tags: -Image formatter

"Image" is not a view mode. Default view modes include "Default", "Teaser" and "Preview" and new ones can be added using contrib modules such as Display Suite or Entity View Modes.

You'll want to visit the manage file display page for the Image file type and then enable/configure the Image formatter for your desired view mode. Then make sure that the "Rendered File" Formater is using that view mode.

jackhutton’s picture

This was a helpful post for me working w displays of jpg's and media files.
https://drupal.org/node/1934674

(about 1/2 way down discusses "Some Media 2.x Configuration")
good luck.

wdseelig’s picture

I want to thank both of you for these posts.

April 15th is now approaching, and I'll be busy "rendering unto Caesar" for the next few days. I'll be sure to post a response here once I can get back to this development effort.

Again, thanks!

Wyckham

wdseelig’s picture

Hello again.

I'm sorry to report that this is still not working, but I have more information about it.

I have been inspecting the HTML that is generated as I try to apply various Image styles to a Rendered File, and here is what I've found:

  • When I upload a file [using the Media File Selector] into a File field, the image itself is placed in my public:// files directory, which is http://mywebsiteurl/files.
  • If I navigate to Structure->File Types->Image->Manage File Display and set the Image style [at the bottom of this screen] to "None (original) the file displays just fine.
  • If, however, I choose a different Image style [say thumbnail], nothing displays when I look at the node.
  • When I look at the HTML that is generated in these two cases, I find that using the "None (original)" image style generates HTML that targets the file in the public:// directory [which, of course, is where it is located].
  • HOWEVER, when I select a different Image style [say thumbnail] the HTML points to a file located in http://mywebsiteurl/files/styles/thumbnail/public/ directory. The image is not there, so the browser displays nothing.

Any help would be greatly appreciated!

wdseelig’s picture

I have read various "hints" that suggest it is possible to construct images "on the fly," and therefore thought that it would be possible to apply alternative image styles to the same underlying image file and get different results. Further, I thought that I could use View Modes to accomplish this.

I now observe, though, that one of the contributed modules that I use [node_gallery] doesn't do things this way at all. Instead, when you upload an image to the node_gallery module, it creates multiple copies of the image file. Each copy of the underlying image file is constructed the way the module needs it to look [i.e., they are different sizes]. Thus, there is no "on-the-fly" constructing of image styles; this work is done at the time that the image is uploaded.

I'm wondering if this is the only way to do things??

Wyckham

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

jenlampton’s picture

Status: Closed (fixed) » Active

I believe I'm having the same problem as the original poster. I would like to set this Photo (image) file type to render an <img> tag instead of a link to the file. However, under the field display settings the only options for how the file is rendered is either "visible" or "hidden".

My use case is that I am using entity_embed module to insert a rendered file entity into the body of a node. I would like it to render an img tag, a caption, and a photo credit together.

Though I can see a way to configure how to display the other fields attached to this file, I am missing how to set an image style (or even call theme('image') for this file.

jenlampton’s picture

Status: Active » Closed (fixed)

Ahh, I just re-read the second reply. Somehow the first time I missed mention of the Manage File Display tab.
Thanks!

jenlampton’s picture