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.

Customising the CMS /

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

Adding an extra DB field disables translations tab

Go to End

2 Posts   1105 Views


Community Member, 11 Posts

9 December 2010 at 2:45am


I'm kind of a newbie and maybe my question is dumb but i can't find a solution for my problem.
I am trying to translate my site but when i extend my Page class with an extra field and add it to the CMSFileds the Translations tab disappears from the CMS, and I cannot translate the page.
I've added the translations method _t() to the label of the field but still nothing.

I am using SilverStripe 2.4.3 with MYSQL and what I've setup:

My config file has:
-------------------------- _config.php --------------------------------------------------------
// Enable Translatable
Object::add_extension('SiteTree', 'Translatable');
Object::add_extension('SiteConfig', 'Translatable');

// Default locale language

// Enable locale
// Set the default site locale

// Define allowed locales overriding those present in i18n::$common_locales
global $allowed_locales;
$allowed_locales = array(
'en_US' => array('English', 'English'),
'de_DE' => array('German', 'Deutsch')
i18n::$common_locales = $allowed_locales;

I've added to my Page.php in the controller init function and the extension:
--------------------------------- Page.php --------------------------------------------------------
public static $extensions = array(

...... Page_Controller.....

if($this->dataRecord->hasExtension('Translatable')) {


Thanks in advance.


Community Member, 11 Posts

9 December 2010 at 10:17pm

Edited: 09/12/2010 11:28pm

Ok, i was wrong with the last reply, the issue is with the disable/enable the CMSFieldsExtension :

So do not use something like this (in the getCMSFields() method, but not only there):

$fields = parent::getCMSFields();

just simply:

$fields = parent::getCMSFields();

will do it just fine.

Thanks and sorry if i got anyone confused.