Jump to:

3432 Posts in 1058 Topics by 734 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Set $icon and canCreate() for built-ins with decorator

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

Page: 1
Go to End
Author Topic: 1441 Views
  • blueskies
    Avatar
    Community Member
    42 Posts

    Set $icon and canCreate() for built-ins with decorator Link to this post

    Hi all,

    Being a control freak, I'd like to get a grip on the decorator thing and use it to set the tree customisation items as listed on http://doc.silverstripe.com/doku.php?id=recipes:customising-the-hierarchy
    I'd like to use the decorator, because I want to set these items on the built-in pages (ErrorPage, Redirector, ...)

    So, for example, I'd like to add an icon to the Redirector page, or set the canCreate of the Error Page to false (or more specifically,set it to function canCreate(){   return !DataObject::get_one($this->class); }

    I've tried to simply make a RedirectorDecorator and used the Object::add_extension in the config. I've put the $icon = "...." right in there, but this did nothing.... so I'm guessing I'm missing something.

    Can someone please point me in the right direction?

  • blueskies
    Avatar
    Community Member
    42 Posts

    Re: Set $icon and canCreate() for built-ins with decorator Link to this post

    Does anyone know how decorators work with built-in-pages? Please?

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