Hello,
I'm trying to have a two column layout where there would be editable title, editable HTMLText content and also a possibility to add an one image.
This is the way I'm trying to do:
<?php
/**
* Defines the ArticlePage page type
*/
class HomePage extends Page {
static $db = array(
'ContentColumns' => 'HTMLText'
);
static $has_one = array(
);
function getCMSFields() {
$fields = parent::getCMSFields();
$multiColumnField = new CompositeField(
new CompositeField(
new TextField('Header1', 'Title'),
new HTMLEditorField('Content1', 'Content'),
new ImageField('ColumnImage1', 'Image')
),
new CompositeField(
new TextField('Header2', 'Title'),
new HTMLEditorField('Content2', 'Content'),
new ImageField('ColumnImage2', 'Image')
)
);
$multiColumnField->setColumnCount(2);
$fields->addFieldToTab('Root.Content.Main', $multiColumnField, 'Content');
return $fields;
}
}
class HomePage_Controller extends Page_Controller {
}
?>
When I try to upload an image, it just doesn't show up. Could it be that the data type I'm trying to set is HTMLText? Any suggestions?
Thank You in advance!