14/03/2012 2:18am

PHP | Problem - Dropdown Displaying ClassName, not Filename


        public function getCMSFields() {


$fields = parent::getCMSFields();

//Get and map list of folders in /assets
if ($Folders = DataObject::get('Folder')) {
$Folders->map('ID', 'Filename');
} else {
$Folders = array('No Folders Found');
}


$fields -> addFieldToTab('Root.Content.ImageFolder', new DropdownField('FolderID', 'Image Folder', $Folders));

return $fields;
}


Post Comment