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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

How to use TranslatableDataObject.


Go to End


2 Posts   1459 Views

Avatar
Webdoc

Community Member, 349 Posts

25 January 2013 at 5:44am

If myobject fields code is something like this:

public function getCMSFields_forPopup()
	{
	return new FieldSet( 
		new DropdownField('Status','Status',singleton('Product')->dbObject('Status')->enumValues()),
		new TextField('ProductName', 'Product Name'),
		new SimpleWysiwygField('Description', 'Description'),
		new TextField('Price', 'Price'),
		new ImageField('Photo', 'Product photo'),
		new FileIFrameField('Manual', 'Product manual')
		);
	}

where i put then the
foreach($this->getTranslationFields() as $field) {
   $f->addFieldToTab("Root.Translations", $field);
}

do i have to add it to the page controling the dataobject?

Avatar
Webdoc

Community Member, 349 Posts

25 January 2013 at 6:07am

Edited: 25/01/2013 8:15am

after adding
TranslatableDataObject::register('Product', array(
'ProductName',
'Description'
));
it made the field tables for mysql but i cant find the place to edit them in cms