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.

Blog Module /

Discuss the Blog Module.

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

Subclassing of BlogEntry doesnt work :(


Reply


2 Posts   1195 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...