• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

attachment icons?

Mutt

Well-known member
#1
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
#2
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:

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

Mutt

Well-known member
#3
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