Jump to:

1835 Posts in 1139 Topics by 554 members

Blog Module

SilverStripe Forums » Blog Module » Subclassing of BlogEntry doesnt work :(

Discuss the Blog Module.

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

Page: 1
Go to End
Author Topic: 1095 Views
  • pali
    Avatar
    Community Member
    33 Posts

    Subclassing of BlogEntry doesnt work :( Link to this post

    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

  • pali
    Avatar
    Community Member
    33 Posts

    Re: Subclassing of BlogEntry doesnt work :( Link to this post

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

    1095 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.