Problem
By default, SharePoint document libraries display graphical icons representing various Microsoft Office Applications (i.e. Excel, Word, etc.). All non-Microsoft documents are represented with a plain white square. How do I display a special icon for other document types?
Solution
There are 3 simple steps to adding graphical icons for non-Microsoft documents. These are to 1) add a graphic, 2) add a mapping to that graphic so SharePoint knows where to look for it and 3) restart the web service (IIS).
Below are instructions on how to add a graphic for PDFs. You can use this technique for other document types as well.
Note: These instructions make the following assumptions:
- The default location of your servers “Program Files” folder as “C:\Program Files”. If that is not the case, adjust the instructions as needed.
- You are using WSS3 or MOSS2007.
- Create or download a small (approx. 17 x 17) icon that represents PDF documents.
Save the file to:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\template\images
- Find a file called docicon.xml in this location:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\template\xml\docicon.xml
Save a copy as a backup, then open it with a text editor (i.e. notepad)
- Add a new Mapping element to the “ByExtension” element as follows:
<Mapping Key=”pdf” Value=”pdficon_small.gif” />
- Save the edited docicon.xml file.
- Restart IIS (iisreset /noforce).
Next Steps
- Check out MSSQLTips.com for great information about Microsoft SQL Server.
Rob has worked with MSSQL since version 6.5 in various capacities (dba, developer, report writer, data warehouse designer) and with SharePoint technologies (WSS2, WSS3, MOSS2007 & MOSS2010 beta) since 2003 as an architect and designer. He has written several articles on MSSQLTips.com and is Editor in Chief (and frequent author) at MSSharePointTips.com. You can contact Rob at rob.fisch [@] yahoo.com.