There is already support for returning an icon image based on the file extension of the file uploaded to the repository. So for each repository item, you can display a custom icon.
In your template.html file, add a token named [FILEICON] where you would like the icon displayed.
In your template.xml file, add an object tag for the token and set the desired Height, Width and whether or not you want clicking on the icon to trigger the download function. PLEASE NOTE: All tags, settings and values are case-sensitive
<Object>
<Token>[FILEICON]</Token>
<Settings>
<Setting>
<Name>Width</Name>
<Value>24</Value>
</Setting>
<Setting>
<Name>Height</Name>
<Value>24</Value>
</Setting>
<Setting>
<Name>DOWNLOAD</Name>
<Value>false</Value>
</Setting>
</Settings>
</Object> |
Then finally, in the /DesktopModules/Repository/images/icons folder, place your icon files for each file type. The repository will look for an image file with the extension in the following order, gif, png then jpg. So, for example, if the file has an XLS extension it will look in the icons folder for xls.gif. If it does not find it, it will look for xls.png. If still not found, it will look for xls.jpg. Finally if it hasn't found an image for the extension, it will use unknown.png as the image.