Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Icons of "folders" in the CMS, Bug ?

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

Page: 1
Go to End
Author Topic: 1154 Views
  • Myrdhin
    Avatar
    Community Member
    67 Posts

    Icons of "folders" in the CMS, Bug ? Link to this post

    Hello

    I would like to change icons in the CMS so i used the static $icon property of my new class like in the Tutorial 2 : Extending a basic Site :

    class myHolder extends Page {

    static $icon = array( "mysite/images/treeicons/myHolder", "folder" );

    ...

    And i put my 2 icons ('myHolder-openfolder.gif' and 'myHolder-closedfolder.gif') in 'mysite/images/treeicons/'

    The $icon property works great for "file" but not "folder" option : i can't have "open" and "closed" icons !? I see only the "open" icon in the CMS...

  • Myrdhin
    Avatar
    Community Member
    67 Posts

    Re: Icons of "folders" in the CMS, Bug ? Link to this post

    I think i've found the problem : in the 'cms/code/CMSMain.php' file, in generateTreeStylingJS() method, line 251-253, i found :

    if(!Director::fileExists($openFolderImage)|| $option = "file" ) $openFolderImage = $fileImage;

    $closedFolderImage = $icon . '-closedfolder.gif';
    if(!Director::fileExists($closedFolderImage) || $option = "file") $closedFolderImage = $fileImage;

    I changed these lines by ($option = "file" --> $option == "file") :

    if(!Director::fileExists($openFolderImage)|| $option == "file" ) $openFolderImage = $fileImage;

    $closedFolderImage = $icon . '-closedfolder.gif';
    if(!Director::fileExists($closedFolderImage) || $option == "file") $closedFolderImage = $fileImage;

    And it works ! Now i see my closedfolder icon and when i open it, i see the openfolder icon in the CMS tree.

  • schellmax
    Avatar
    Community Member
    126 Posts

    Re: Icons of "folders" in the CMS, Bug ? Link to this post

    confirmed - i created a ticket at http://open.silverstripe.org/ticket/5019
    thanks for sharing

    1154 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.