2

In the File Entity module, what is the purpose of multiple enabled displays and Display precedence order for a single display mode? Or what is the use case where I would need to provide multiple ones and define precedence of one over another?

There is little to no documentation on File Entity (understandably as it is still under heavy development), and I am trying to wrap my head around it a bit more. I just can't think of a use-case where I would need more than one "display" for a single "display mode", where the first would not "validate" and therefore look at subsequent ones that are defined.

enter image description here

4

I just can't think of a use-case where I would need more than one "display" for a single "display mode", where the first would not "validate" and therefore look at subsequent ones that are defined.

It's not a feature that I expect it used very much, but that is exactly the purpose.

An example, where one looks at the user agent, could be:

Let's say you're showing a video, a video player is your primary option.

Then there's a user agent that you recognize as a screen reader. Suddenly, showing video doesn't make sense. However, the audio still does, so you fall through the first option, to your second, which is an audio player, that only pulls in the audio stream, significantly reducing the bandwidth usage for both server and client.

Finally, a really low powered mobile device comes along, and then you simply default to displaying an image of the videos first frame, together with a link "Mail me this video", making it convenient for the user to find the video again when using a more powerful computer.

4
  • Interesting and sounds like a very powerful feature. What would define these triggers then? It doesn't appear that file entity module provides any sort of mechanism for this. Is it just providing a spot for contrib to fill in the need? – Nigel Waters Aug 23 '13 at 18:03
  • It appears my question is answered in another broader question on this site. Not sure if I should close this one or not though. drupal.stackexchange.com/questions/40229/… – Nigel Waters Aug 23 '13 at 18:18
  • @NigelWaters It's a long time since I looked at the code, but I seem to recall that a formatter can return NULL, or perhaps FALSE, instead of text in the form of markup, to indicate "failure, move on", but as I said, long ago, could have changed since then. – Letharion Aug 23 '13 at 18:57
  • 1
    That link above provides a great example on this. Because multiple media providers can use the same field, formatters are arranged in a top-to-bottom cascade. Drupal will use the first formatter that can be applied to the output of a field. If a video field enables the "Media: Youtube Video", "Media: Vimeo Video", and "Large filetype icon" formatters for the "Full" view mode, Drupal will use the Youtube formatter if the file's mime type is video/youtube, the Vimeo formatter if the mime type is video/vimeo, and fall back to the large filetype icon if the mime type is video/{anything else}. – Nigel Waters Aug 23 '13 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.