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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Adding translatable fields


Go to End


2 Posts   1605 Views

Avatar
MrHyde

Community Member, 23 Posts

10 January 2009 at 12:44am

Edited: 10/01/2009 6:57am

Hi, i'm working on my HomePage pagetyp and wondering how to make the datafields i added translateable. I'm new to silverstripe and took a look to the tutorials, but i feel that i dont really get the sense of it.

This is my code so far (HomePage.php):

class HomePage extends Page {

   static $db = array(
      'Name1' => 'Varchar(20)'
       );
      
   static $has_one = array(
   	     );
   static $icon = "mysite/images/treeicons/home";
   
   function getCMSFields() {
   $fields = parent::getCMSFields();
   $fields->removeFieldFromTab("Root.Content.Main","Content");
   
   $fields->addFieldToTab('Root.Content.Main', new TextField('Name1'), 'Content');
      
   return $fields;
}

Can anybody help?

Avatar
MrHyde

Community Member, 23 Posts

10 January 2009 at 7:05am

I shortened the code i posted above. Its basicly just about making Name1 translateable.
I took some further look to this forum and found out that this problems appears to be a well known and beeing discussed here:
http://ssorg.bigbird.silverstripe.com/archive/show/21167?showPost=116768&start=0

Cause this Topic is a bit older I'm wondering if there is any solution which came along SS v2.2.3. Need your help please...