4424 Posts in 1267 Topics by 945 members
Customising the CMS
SilverStripe Forums » Customising the CMS » how to override $defaults with add_extension?
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba
|
Page:
1
|
Go to End | |
| Author | Topic: | 1141 Views |
-
how to override $defaults with add_extension?

21 October 2009 at 11:54pm
Is it possible to override the defaults array of a page type using add_extension?
I want to use the blog module as a kind of press-archive and set ProvideComments to false without hacking the module (->future upgrades)
this is what i tried and its not working:
in mysite/_config.php:
DataObject::add_extension('BlogEntry', 'BlogEntryExtension');in mysite/code/BlogEntryExtension.php:
class BlogEntryExtension extends DataObjectDecorator {
public static $defaults = array(
"ProvideComments" => false,
'ShowInMenus' => false
);
} -
Re: how to override $defaults with add_extension?

2 November 2009 at 8:33am
You can't override statics like this, please use the extraStatics() method.
| 1141 Views | ||
|
Page:
1
|
Go to Top |


