Hey all,
I need an HTML editor field for my DataObject's Content field, which is managed in a data object manager popup window.
Problem:
SimpleHTMLEditorField: does not appear
SimpleTinyMCEField: renders a plain textarea
SimpleWYSIWYGField: also renders a plain textarea
I'm using SS 2.4.5 and the latest DOM.
This is my code:
HTMLWidget.php
class HTMLWidget extends DataObject
{
static $db = array(
"Title" => "Varchar",
"Content" => "HTMLText",
"Color" => "Varchar"
);
static $has_one = array(
"Page" => "Page"
);
function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Main", new TextField('Title', 'Widget Title'));
$fields->addFieldToTab("Root.Main", new TextField('Color', 'Title Background Color'));
$fields->addFieldToTab("Root.Main", new SimpleWYSIWYGField('Content', 'Content'));
return $fields;
}
}
Page.php
class Page extends SiteTree
{
public static $db = array(
);
static $has_many = array(
"HTMLWidget" => "HTMLWidget",
);
function getCMSFields()
{
$fields = parent::getCMSFields();
$widgets = new DataObjectManager(
$this,
'HTMLWidget',
'HTMLWidget'
);
$fields->addFieldToTab("Root.Content.Widgets", $widgets);
return $fields;
}
}
What do I gotta do!?
Thanks in advance :)