Jump to:

5554 Posts in 1742 Topics by 1227 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Adding an extra DB field disables translations tab

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

Page: 1
Go to End
Author Topic: 759 Views
  • Hypnus
    Community Member
    11 Posts

    Adding an extra DB field disables translations tab Link to this post


    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.

  • Hypnus
    Community Member
    11 Posts

    Re: Adding an extra DB field disables translations tab Link to this post

    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.

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.