10392 Posts in 2202 Topics by 1713 members
| Go to End | Next > | |
| Author | Topic: | 2190 Views |
-
dynamic cms sitetree icon

10 June 2010 at 12:21pm
Hi all,
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!
Barry
-
Re: dynamic cms sitetree icon

22 September 2010 at 5:24pm
I have the same question as Keeny. Anyone know if this is possible?
-
Re: dynamic cms sitetree icon

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.
http://api.silverstripe.org/2.4/sapphire/core/Object.html#methodset_static
-
Re: dynamic cms sitetree icon

29 September 2010 at 10:06pm
have found a solution for changing the icon?
-
Re: dynamic cms sitetree 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');
results in
url("themes/mysite/icons/news.png-file.gif")
-
Re: dynamic cms sitetree icon

1 November 2010 at 3:25am
You dont need the file part:
Object::set_static('ErrorPage', 'icon', 'mysite/images/icons/error');
-
Re: dynamic cms sitetree icon

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 ...
Cheers,
Christian -
Re: dynamic cms sitetree icon

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.
| 2190 Views | ||
| Go to Top | Next > |







