Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Blog Module /

Discuss the Blog Module.

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

Subclassing of BlogEntry doesnt work :(


Go to End


2 Posts   1963 Views

Avatar
pali

Community Member, 33 Posts

25 May 2009 at 8:52pm

hello,

im trying to put some new feautures to blogentry.
I created file PaliBlogEntry in mysite/code with this in it:

<?php
/**
 * Extends the BlogEntry page type
 */

class PaliBlogEntry extends BlogEntry {
   static $db = array(
   );    
   static $has_one=array(
       'Image' => 'Image'
    );
    
    public function getCMSFields()

	{

	$fields = parent::getCMSFields();	



	$fields->addFieldToTab("Root.Content.Main", new ImageField("Image"), "Content");
    

	return $fields;

	}	
 
}
 
class PaliBlogEntry_Controller extends BlogEntry_Controller {
	
}
?>

Than ...dev/build...

But it doesnt show image field :(

If i put it directly to blog/code/BlogEntry everything is OK... But i dont wanna touch the core.

Maybe im missing something easy here... but cant find what :(

Regards

pali

Avatar
pali

Community Member, 33 Posts

26 May 2009 at 1:32am

oh, i see... it works, but i need to select "Pali Blog Entry" Pge Type in Behaviour Tab...