Content last modified Monday 6 March 2017
hop to #bottom
Shaun Humphreys
Current version:
About It:
Get it:
Rate it:
  • Helpful?
  • 0 Yes
  • 1 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!


srh_file_icon displays either the file extension (eg PDF, DOC, ZIP) or an icon image for a file. Icon images must be present in the /images directory for each file type required (eg pdf.png, doc.png — filenames should be lowercase). The icon image type (eg png, gif) can also be specified.

Use: txp:srh_file_icon displaytype=”“ imagetype=”“ />

  • displaytype – ‘text’ or ‘image’ defaults to ‘text’
  • imagetype – the type of image file used for the icon, defaults to png

You can get your file icons here:

This plugin is a far more basic verion of mrz_file_preview (which did a lot more and was written by someone who knows PHP).

This is my first plugin, and if you look at the code you can probably tell I don’t know PHP at all. If I keep reading my PHP book, I might get around to adding some other obvious attributes like class, width & height, alt-text etc.


Article Request Count:
Initially released:
Posted here:
25 Jan 2007

You may want to leave your comments/questions at the Forum thread for quicker feedback. Otherwise, comment away:

Commenting is closed for this article.

Commented (1)

Great utility! Note that it isn’t consistent with capitalization. It outputs pdf.png and JPG.png. Name your files accordingly because some browsers are picky.

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.




There are also tag clouds, 'cause those are fun.
Published with Textpattern