0

I'm using modules Media entity and Entity embed and Entity Browser, which all work fine for images and video.

Now I'd like to use the Media framework to also manage some PDF and other non-image documents and embed them into my nodes and other places. Uploading and managing generic documents works – I've tried both the "Generic file" provider, as well as the contributed "Media entity document" module.

But embedding is a nightmare. The embed dialog will let me display generic file media entities as either ID, title or thumbnail and optionally link to the media entity's page. All of this is useless to me. I don't want to allow visitors to access media pages, I'd like a simple link to the (downloadable) file instead.

Can someone tell me how to embed and make use of generic file media?

  • There is a module for this drupal.org/project/medf – Kevin Aug 6 '17 at 20:20
  • Although it has a specific use case. Media URIs need a download path to force the browser to download the file. This does not yet exist, to my knowledge. – Kevin Aug 6 '17 at 20:23
  • I'm not worried about download vs. display in browser. It's just I don't see a decent way to render an embedded PDF (for example) document. The link that is provided by the Embed module leads to the media page, not to the actual document file's URL. – Hendrik Aug 6 '17 at 21:02
  • 1
    You'd likely have to build a handler then, if one does not already exist. This is due to media not knowing about your file - it only represents a media object (which could have many file/image fields on it). – Kevin Aug 6 '17 at 21:12
  • What do mean by 'handler'? – Hendrik Aug 8 '17 at 16:14

Your Answer

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

Browse other questions tagged or ask your own question.