attachment icons?


Well-known member
how do I set different icons for each attachment type? right now it's either a thumb of the image or the generic icon. i'd like zip files to have different icons than mp3s. thanks

Jake Bunce

XenForo moderator
Staff member
You can edit this template:

Admin CP -> Appearance -> Templates -> attached_files

You can use a condition structure like this to conditionally insert HTML based on the file extension:

<xen:if is="{$attachment.extension} == 'zip'">
<xen:elseif is="{$attachment.extension} == 'mp3'" />
<xen:elseif is="{$attachment.extension} == 'jpg'" />
This would be inside of the foreach loop in that template.


Well-known member
thanks bruce. I knew I could code it like that. just assumed there was something built-in that I was missing. if I'm going to do that, could probably just drop the extension into the icon name & loose the whole if else thing. when I do it, I'll post it. :) thanks again