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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Custom fields - HTMLText


Go to End


1128 Views

Avatar
estheblessed

Community Member, 3 Posts

23 May 2016 at 5:55am

Hi,

I am trying to add a second content area using the following:

<?php
class Publication extends Page {

private static $db = array (
'SideInfo' => 'HTMLText',
);

public function getCMSFields() {
$fields = parent::getCMSFields();

$fields->addFieldToTab("Root.Content.RightContent", new HTMLEditorField('SideInfo'));

return fields;
}

}
class Publication_Controller extends Page_Controller {
}

But when I try to add a new page of that type, it creates the page but I get the message 'Internal server error'. So I am assuming there is something wrong with that code above ^

Many thanks in advance