When working within a SharePoint publishing site, the Edit Content window allows for some really cool WYSIWYG editing.
As well as formatting of styles, fonts, etc, there’s is a quick-click to include a link to a web-page (hyperlink) – or to a document, such as a Word DOCX, or PDF.
You often see this shown on pages with link to a map, or restaurant menu, etc.
You can tick a box to “Display link with icon”, to notify the user which type of file will be opened when clicking the link.
This works fine for files such as Microsoft Word, Excel, etc (Office Suite). but other file types will show the default icon (ICGEN.GIF) – which looks pretty crappy. (eg. when the file type is PDF)
But – you can include a custom icon within the SharePoint “hive” and update a config file to show the correct icon.
You could even include some other icon type, basically for ANY file type (extension).
Here’s the steps to update the icon to use :
- Firstly, copy or create an icon file to use (16×16)
- Here’s a good image I found for use with “PDF” file types :
- Copy this file to the following location :
C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12TEMPLATEIMAGES
- Next up, switch across to the XML folder :
C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12TEMPLATEXML
- Open the following XML file :
- Scroll down and include a new setting for “Mapping” :
<Mapping Key=”pdf” Value=”pdf16x16.gif”/>
- Save the file – and then do an IISRESET.
NOTE : Unfortunately – you can’t simply “refresh” the page, it won’t pick up the new image.
You will have to re-add the link – as this image is added when you click OK to the “Add Hyperlink” dialog (ie. when doing content editing).
In the following screen shot, the initial “click here” retains the original icon – but the new link has the new image inserted.
Any NEW content pages will have the correct icon – just might need to re-check/re-link to the specific file/s needed.
Thanks to Zabi Chennai for this tip.