Hi, I'd like to insert some boxes in homepage with a image and text. So in Page.php I set:
<?php
class Page extends SiteTree {
static $db = array(
'Date' => 'Date',
'Author' => 'Text'
);
static $has_one = array(
'TeaserText' => 'Content',
'Picture' => 'Image'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Box', new HtmlEditorField("TeaserText","Text"));
$fields->addFieldToTab('Root.Content.Box', new ImageField('Picture'));
$fields->addFieldToTab('Root.Content.Main', new textField('Author'));
$fields->addFieldToTab('Root.Content.Main', new textField('Date'));
return $fields;
}
}
In Admin I see "Text" as editor and " Picture" as image. If I insert a new image and refresh the page in frontend the image appears but when I insert text or other in the editor I can't save anything.
I'd like to insert in admin text with editor to see in the pages text and image in specific boxes but SS doesn't allow me to save what I write in the editor.
How can I do?
thanks