10808 Posts in 2494 Topics by 1782 members
Page: 1 2
|Go to End||Next >|
10 June 2010 at 12:21pm
I know that you can customise the cms page tree using statics such as:
// tree customisation
static $icon = "mysite/images/icons/my-pretty-icon";
Is it possible to make the icon dynamic - either using a function icon() or maybe setting it on an event (page saved, etc)?
Basically under the behaviour tab I want to have a checkbox that affects the icon.
Thanks a lot!
22 September 2010 at 5:24pm
I have the same question as Keeny. Anyone know if this is possible?
22 September 2010 at 6:30pm
You may be able to overload the default static using Object::set_static('PageType', 'icon', 'path/to/icon.png'); see the set static docs for more info. Not sure if it'll work but its worth a try.
29 September 2010 at 10:06pm
have found a solution for changing the icon?
1 November 2010 at 2:57am
using Object::set_static() partially works but it still search for a GIF file, e.g.
Object::set_static('news', 'icon', 'themes/mysite/icons/news.png');
1 November 2010 at 3:25am
You dont need the file part:
Object::set_static('ErrorPage', 'icon', 'mysite/images/icons/error');
1 November 2010 at 4:49am
^^ thats right, but you end up using .gif icons anyway.
I posted a possible enhancement ticket to use .png icons: http://open.silverstripe.org/ticket/6155
Please tell me what you think about it. Maybe there is still a better way to use .png icons ...
1 November 2010 at 9:01am Last edited: 1 November 2010 9:01am
Christian that seems a reasonable solution, the extension shouldn't have been hard coded.
Page: 1 2
|Go to Top||Next >|