Jump to:

5452 Posts in 1673 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » File type icon

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 3165 Views
  • Victor
    Avatar
    Community Member
    128 Posts

    File type icon Link to this post

    If I put a link to pdf file, pdf icon is shown
    How to make the similar arrangement for another file type (I have an icon
    http://akregator.kde.org/wiki/skins/common/images/icons/fileicon-djvu.png

    Thanks. Victor

  • Ben Gribaudo
    Avatar
    Community Member
    181 Posts

    Re: File type icon Link to this post

    Hi Victor,

    Looking at File's method Icon(), it looks like an easy way to do this would be to put your custom icon in /sapphire/images/app_icons, with the icon named ext_32.gif (where ext is the appropriate file extension).

    Ben

  • Victor
    Avatar
    Community Member
    128 Posts

    Re: File type icon Link to this post

    It did not work even if I added in typography.css lines similar to those for pdf (filetype I am trying to accommodate is djvu)

    Victor

  • Ben Gribaudo
    Avatar
    Community Member
    181 Posts

    Re: File type icon Link to this post

    Hum...not sure what the answer is. Maybe someone with more experience with File can comment.

  • schellmax
    Avatar
    Community Member
    126 Posts

    Re: File type icon Link to this post

    for me, the solution by ben gribaudo worked.
    i needed to manage swf files so i placed a file 'swf_32.gif' in the folder mentioned by ben.
    thanks for sharing

  • ayyurek
    Avatar
    Community Member
    41 Posts

    Re: File type icon Link to this post

    You can make easily make it on the CSS file. Example code can be

          a[href$=".DJVU"], a[href$=".djvu"], {
          padding-top: 5px;
          padding-bottom: 5px;
          padding-left: 20px;
          background: transparent url(path/to/your/images/folder/fileicon-djvu.png) no-repeat 5px center;
          display:block;
       }

  • MattyJ
    Avatar
    Community Member
    11 Posts

    Re: File type icon Link to this post

    Thanks, this helped me a lot. Just note in the code above there is a stray comma you'l need to delete just before the {. Also you'll need to specify the width and height of the image.

    3165 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.