Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Apr 25, 2012 @ 10:54
    Jesper Ordrup
    0

    Icons in damp media browser

    Hi all,

    For some reason dot and dotx files are displayed with folder icons in the media browser. In the media section they are created as files.

    Is it configurable or otherwise changeable?

    best

    Jesper

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Apr 25, 2012 @ 10:57
    Jeroen Breuer
    0

    In DAMP 2.0 if we can't preview an image we use the media type icon. In this case I believe the file media type has a folder icon so that's why it's displayed. You could change that icon, or create a new media type and give that the proper icon.

    Jeroen

  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Apr 25, 2012 @ 11:05
    Jesper Ordrup
    0

    Hi Jeroen,

    Super. I could change that. I can see that you use word icons for doc files so you must do an additional compare I guess? Ideally I would like to associate the dot and dotx files with word too?.

    best

    Jesper

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Apr 25, 2012 @ 11:17
    Jeroen Breuer
    0

    The word icon isn't used anymore. That was used in DAMP 1.0, but it only worked for a couple of extensions so in DAMP 2.0 we changed it so it uses the media type icon. This way custom media types are also better supported.

    Jeroen

  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Apr 25, 2012 @ 11:40
    Jesper Ordrup
    0

    Hi Jeroen,

    Sorry to bother you one more time - but I'm seeing Word icons all over :-) Just not on dot and dotx files :-)

    A few screenshots:

    How media type "File" is defined (no word icons there):

     

    How media browser looks
    Quite a lot of word icons. Where do they come from. No 2 file is a dot file ..

     

     



    And in content

    Thats a lot of word icons :-)

    I'm using Damp 2.0

    Best

    Jesper

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Apr 25, 2012 @ 12:42
    Jeroen Breuer
    0

    Sorry what I said is wrong :). Just looked at the source and it only uses the media type icon if there is no umbracoFile property on the media item (for example a folder) or if the icon is not found. Here is a quick copy paste of what extensions are supported:

       if (DigibizConstants.IMAGETYPES.IndexOf("," + extLow + ",") < 0)
                {
                    switch (extLow)
                    {
                        case "docx":
                        case "doc":
                            return umbPath + "/plugins/DigibizAdvancedMediaPicker/Doc_icon.png";
                        case "xlsx":
                        case "xls":
                        case "csv":
                            return umbPath + "/plugins/DigibizAdvancedMediaPicker/Excel_icon.png";
                        case "pptx":
                        case "ppsx":
                        case "ppt":
                        case "pps":
                            return umbPath + "/plugins/DigibizAdvancedMediaPicker/Power_icon.png";
                        case "pdf":
                            return umbPath + "/plugins/DigibizAdvancedMediaPicker/Pdf_icon.png";
                        case "txt":
                            return umbPath + "/plugins/DigibizAdvancedMediaPicker/Text_icon.png";
                        case "aac":
                        case "aif":
                        case "iff":
                        case "m3u":
                        case "mid":
                        case "mp3":
                        case "mpa":
                        case "ra":
                        case "wav":
                        case "wma":
                            return umbPath + "/plugins/DigibizAdvancedMediaPicker/Audio_icon.png";
                        case "3g2":
                        case "3gp":
                        case "asf":
                        case "asx":
                        case "avi":
                        case "flv":
                        case "mov":
                        case "mp4":
                        case "mpg":
                        case "rm":
                        case "swf":
                        case "vob":
                        case "wmv":
                            return umbPath + "/plugins/DigibizAdvancedMediaPicker/Video_icon.png";
                        case "7z":
                        case "deb":
                        case "gz":
                        case "pkg":
                        case "rar":
                        case "sit":
                        case "sitx":
                        case "zip":
                        case "zipx":
                            return umbPath + "/plugins/DigibizAdvancedMediaPicker/Zip_icon.png";
                        default:
                            MediaType mt = MediaType.GetByAlias(mediaType);
                            return umbPath + "/images/thumbnails/" + mt.Thumbnail;
                    }
                }

    It first looks if the we can preview the image. If we can't we show a default icon. You can find that code in the DigibizMediaHelper.cs file. You can just change it so it supports your extensions as well.

    Jeroen

  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Apr 25, 2012 @ 12:56
    Jesper Ordrup
    0

    Hey Jeroen,

    Faaantastic. Thanks. I'll give it a go! Next DAMP might have this in a config file :-)

    best

    Jesper

Please Sign in or register to post replies

Write your reply to:

Draft