Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

In Content Linking to PDF's

Vote:
 

HI,

 I'm relatively new to the EPiServer system. I've only been working in this for about two months and I've reached something that just stumps me. I've read similar posts on this site but I'm not sure what to do to solve this. I've uploaded some PDF's to the Media section of my site. They upload fine and I'm able to link to them in content VIA the Editor but when I try to open them I'm just taken to the login screen. If I log in I'm seeing something stating that "Preview is not available for this item." How can I display an uploaded file. We rely heavily upon PDF's and I'm afraid that I've completely missed a step.

EPiServer 9

#144384
Feb 11, 2016 22:43
Vote:
 

If you just drag the media file /pdf to the editor it will probably try to find a way to render the content type (Generic Media if you haven't created a separate one) in the editor. If you lack a matching display template or partial view for it I guess you will get a similar error message.

Tried using the link button in editor instead to create link?

Try creating a display template for generic media that only renders a link to it. 

If you want you can of course add a new media content type for pdfs and make a custom display template for it with matching name (or using a UIhint attribute) that actually renders the pdf on the page.

Hope that helps...

#144385
Feb 11, 2016 23:59
Vote:
 

I was using the link button to create the link. It looks like creating a display template may be the way to go.

#144386
Feb 12, 2016 0:03
Vote:
 

Ok, probably this error then?

http://world.episerver.com/forum/developer-forum/-EPiServer-75-CMS/Thread-Container/2014/6/Direct-download-link-to-MediaData-type-file/

#144387
Feb 12, 2016 0:06
Vote:
 

Brilliant, that was the solution I've been looking for and just couldn't find.  Thanks.

#144388
Feb 12, 2016 0:08
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.