Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, Ed, biapar, Willr, Ingo, swaiba


Go to End

3 Posts   2060 Views


Community Member, 13 Posts

15 February 2011 at 1:30pm

Please, Help. How I can use 2 addFieldToTab with 1 getCMSFields

* Defines the HomePage page type

class HomePage extends Page {

static $db = array (
'SolutionName' => 'Text'

static $has_many = array(

public function getCMSFields()
$f = parent::getCMSFields();
$manager = new FileDataObjectManager(
$this, // Controller
'Slideshows', // Source name
'Slideshow', // Source class
'FullImage', // File name on DataObject
'Title' => 'Title',
'Description' => 'Description'
), // Headings
'getCMSFields_forPopup' // Detail fields (function name or FieldSet object)
// Filter clause
// Sort clause
// Join clause

// If undefined, all types are allowed. Pass with or without a leading "."

// Label for the upload button in the popup
$manager->setBrowseButtonText("Upload (JPG or PNG only)");

// In grid view, what field will appear underneath the icon. If left out, it defaults to the file title.

// Plural form of the objects being managed. Used on the "Add" button.
// If left out, this defaults to [MyObjectName]s

$f->addFieldToTab("Root.Content.Slideshows", $manager);
$f->addFieldToTab("Root.Content.Main", new TextField('SolutionName'), 'Content');

return $f;

class HomePage_Controller extends Page_Controller {



Forum Moderator, 4102 Posts

15 February 2011 at 1:48pm


Community Member, 13 Posts

15 February 2011 at 9:49pm

Sorry, but how does it help me? In this code))