7938 Posts in 1466 Topics by 943 members
|Go to End|
6 February 2010 at 12:52am
i have a video page working fine on my site , thanks to UC, i would like to have an option of drag and drop sorting option in the admin panel,the code is
class Video extends DataObject
static $db = array (
'Title' => 'Varchar(100)',
'Description' => 'Text'
static $has_one = array (
// Make sure this comes first
'VideoPage' => 'VideoPage',
* This relationship could be as simple as 'Video' => 'File' provided
* FileDataObjectManager::$upgrade_video is true (defaults to true).
* However, if we know the page will only contain videos, we can simplify things by
* using a direct relationship to FLV. This will give us the benefit of not having
* to worry about the allowed_file_types setting.
* To make this an audio resource, set the relationship to the MP3 class, e.g.
* 'AudioFile' => 'MP3'. Audio files are also subject to automatic upgrades, however,
* based on FileDataObjectManager::$upgrade_audio. (true by default).
'Video' => 'FLV'
* Before getting started, be sure to test your FFMPEG installtion by adding:
* to your _config.php!
class VideoPage extends Page
static $has_many = array (
'Videos' => 'Video'
public function getCMSFields()
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Videos", new FileDataObjectManager(
array('Title' => 'Title', 'Description' => 'Description'),
class VideoPage_Controller extends Page_Controller
<% control Videos %>
<% end_control %>
thank you in advance
|Go to Top|