7911 Posts in 1354 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » [SOLVED] Problem Adding DataObjectManager
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 597 Views |
-
[SOLVED] Problem Adding DataObjectManager

1 October 2009 at 9:54am Last edited: 1 October 2009 10:55am
I can't seem to add the DOM to CMS, its working in other page types, It must be a typo I'm not seeing
Here is the DataObject
class AccessCodeUser extend DataObject {
static $db - array(
'Name' => 'Text',
'Email' => 'Text',
'ProductName' => 'Text'
);
static $has_one = array(
'AccessCodePage' => 'AccessCodePage',
);
public function getCMSFields_forPopup()
{
return new FieldSet (
new TextField('Name'),
new EmailField('Email'),
new TextField('ProductName')
);
}
}And in the PageType
class AccessCodePage extends Page {
public static $db = array(
'LifestyleText' => 'HTMLVarchar(255)',
'AccessCode' => 'Text'
);
public static $has_many = array (
'ExtraPageImages' => 'ExtraPageImages',
'AccessCodeUsers' => 'AccessCodeUser'
);
function getCMSFields() {
$f = parent::getCMSFields();
$f->removeFieldFromTab('Root.Content.Main', 'LifestyleText');
$f->addFieldToTab("Root.Content.AccessCode", new TextField("AccessCode","Access Code"));
$f->addFieldToTab("Root.Content.AccessCode", new DataObjectManager(
$this,
'AccessCodeUsers',
'AccessCodeUser',
array('Name' => 'Name','Email'=>'Email','ProductName' => 'ProductName'),
'getCMSFields_forPopup'
));
return $f;
}
} -
Re: [SOLVED] Problem Adding DataObjectManager

1 October 2009 at 10:09am
What do you mean you "can't?" Errors? What's it doing/not doing?
-
Re: [SOLVED] Problem Adding DataObjectManager

1 October 2009 at 10:47am Last edited: 1 October 2009 10:56am
Standard White Screen when Accessing the CMS even in Devmode. Everything is fine until I add the DataObejctManager.
EDIT Found the Typo
| 597 Views | ||
|
Page:
1
|
Go to Top |

