Red square with a white fabrik samt namet Republic Factory

File Extension Icon / file_ext_icon (1.0)

“File Extension Icon” is a plugin for ExpressionEngine. It returns an icon or the file type as text for a specific file, based on the file's extension.

Download Plugin

Usage

The plugin returns an icon (or the type as text) for a specific file based on the file extension (ie. .gif, .jpg, .pdf).

The default parameters works great with the Silk icons by FamFamFam but you can customize the icons any way you want.

Basic usage:

{exp:file_ext_icon width="10" height="10"}http://www.somesite.com/some_file.jpg{/exp:file_ext_icon}

Returns:

<img src="/images/icons/jpg.png" alt="jpg" width="10" height="10" />

Making use of the print_type parameter (to add CSS class in this case):

<li class="{exp:file_ext_icon print_type='yes'}http://www.somesite.com/some_file.jpg{/exp:file_ext_icon}">Text</li>

Returns:

<li class="jpg">Text</li>

Parameters (examples):

Download

Download File Extension Icon plugin for ExpressionEngine.
See the ExpressionEngine Forums thread for more information.

Disclaimer

By downloading this you also take full responsibility for using this plugin. We believe it's good and try our best to write un-fucked code, but if you mess up it's your fault... ;-)