I am trying to add an option to add images to blog posts. Have used the post here http://www.ssbits.com/tutorials/2011/adding-an-image-to-a-blog-post-using-decorators-and-the-silverstripe-blog-module/
I have changed the code as per ss3 requirements yet I don't see upload image option when creating a new blog post.
Created a file BlogEntryDecorator.php inside mysite/code like:
<?php
class BlogEntryDecorator extends SiteTreeDecorator {
static $has_one = array(
'BlogImage' => 'Image'
);
public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Images", new UploadField('BlogImage'));
return $fields;
}
}
and then in mysite/_config.php added the following line:
DataObject::add_extension('BlogEntry', 'BlogEntryDecorator');
Kindly suggest as to how can I make this work