Post

Sitecore – Add missing icons for specific media types

Recently, I was trying to save the PDF file in the media library and found this issue. The PDF file used empty icon instead.

Luckily, this seems a common issue and solution can be easily googling out. Sitecore has official document in its knowledge base about this issue.

Missing icons for specific media types

What I want to point out is if you search this issue from google, you will be very likely found some other blog posts provide the similar approach, the only difference comparing to Sitecore official document is the type specified in the generator.

1
<generator type="Sitecore.Resources.Media.MediaThumbnailGenerator, Sitecore.Kernel">

The type seems redundant or causing icon failed to be displayed in my current Sitecore v8.0 update 3.

Below is my patch config instead of modifying the web.config

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<mediaLibrary>
  <mediaTypes>
    <mediaType name="PDF file" extensions="pdf" patch:before="*[@name='AVI video']" >
    <mimeType>application/pdf</mimeType>
      <forceDownload>false</forceDownload>
      <sharedTemplate>system/media/unversioned/pdf</sharedTemplate>
      <versionedTemplate>system/media/versioned/pdf</versionedTemplate>
      <thumbnails>
        <staticFile>/sitecore/shell/Themes/standard/images/pdf_icon.png</staticFile>
      </thumbnails>
    </mediaType>
  </mediaTypes>
</mediaLibrary>

Happy Coding! 😇

This post is licensed under CC BY 4.0 by the author.

Comments powered by Disqus.

© Vincent. Some rights reserved.