Hi there,
you can add any type of fields to DataObjects.
Here is an example of a DataObject to embed videos from youtube
<?php
class Videos extends DataObject {
static $db = array(
'Title' => 'Varchar(255)',
'Description' => 'Text',
'YouTubeCode' => 'HTMLText' //code to embed the video
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main', new TextField('Title', 'Video Title'));
$fields->addFieldToTab('Root.Main', new TextareaField('YouTubeCode', 'YouTube code to embed'));
return $fields;
}
}
?>
you can add more fields if you want.
Then just add $YouTubeCode in your template, as usual.