27 January 2010 at 4:44pm
I am looking to extend the CMS for the blog entries. I want to allow a few more fields (like a header image for example) when the user enters a blog entry, and remove some of the fields normally associated with the "Page" type, as they don't apply to my blog.
I know it's best not to add these in the blog module, so that when it gets upgraded, I won't lose my changes. What is the best way to extend this module?
28 January 2010 at 10:32pm
The best way to extend module / core functionality is to use decorators. http://doc.silverstripe.org/doku.php?id=dataobjectdecorator
Dan, To answer your specific issue - you should be able to customize the CMS within a decorator by using the updateCMSFields() function. See http://doc.silverstripe.org/doku.php?id=dataobjectdecorator#modifying_cms_fields
31 January 2010 at 8:22pm
Yes, as it says on the dataobjectdecorator page you can define a updateCMSFields(&$fields) function. You should be able to then call any of the usual cmsfields functions - http://doc.silverstripe.org/doku.php?id=getcmsfields