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

attachment icons?

Discussion in 'Styling and Customization Questions' started by Mutt, Apr 18, 2012.

  1. Mutt

    Mutt 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
    Digital Doctor likes this.
  2. Jake Bunce

    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.
    M@rc, aiman.h.kallaf and Shelley like this.
  3. Mutt

    Mutt 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
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Good idea. :)

Share This Page