I want to add a 2nd field in the CMS for the Page Type intended for flash video. My initial thought was to just add a 2nd HtmlEditorField and use the convenient insert flash object tool. (I want a separate field because in some cases I have a control on the page and want the video to be last on the page)
I used this code:
class Page extends SiteTree {
public static $db = array(
'Video' => 'HtmlText'
);
public static $has_one = array(
'Photo' => 'Image'
);
//Add CMS Field for Image and Video
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Images', new ImageField('Photo'));
$fields->addFieldToTab('Root.Content.Main', new HtmlEditorField('Video'));
return $fields;
After adding the 'Video' => 'HtmlText' in the $db array I started getting javascript errors in the cms and it would not allow me to save any content.
Can someone explain what I am doing wrong, and if you know of one, what a better method would be for easily adding a flash video via the cms might be?
Thanks in advance!