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.

Archive /

Our old forums are still available as a read-only archive.

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

I have to translate a field


Go to End


2 Posts   1761 Views

Avatar
antonio

Community Member, 4 Posts

9 November 2008 at 1:57pm

Hi,
i create a new field, when i start a translation I have the main content area and the BannerText area wich I have created. But when i go saving only the content area wil be translated, instead the BannerText area will be remain the same for each language. I try more then one way to take BannerText area translable but without success. I want to take translable the text nearby the foto on www.angelacelentano.com wich is the BannerText area. Thanks for any help.

class HomePage extends Page  {
   static $db = array(
   'BannerText' => 'HTMLText',
   );
   static $has_one = array();



function getCMSFields() {
   $fields = parent::getCMSFields();
 
   $fields->addFieldToTab('Root.Content.Main', new HtmlEditorField('BannerText', 'Testo Intro'));
   return $fields;
}
}

class HomePage_Controller extends Page_Controller { 
} 

Avatar
antonio

Community Member, 4 Posts

11 November 2008 at 12:51am

I try to insert this:
static $extensions = array(
"Translatable('BannerText')"
);

but it doesn't work .....

class HomePage extends Page {
static $db = array(
'BannerText' => 'HTMLText',
);
static $has_one = array();
static $extensions = array(
   "Translatable('BannerText')"
  );

function getCMSFields() {
$fields = parent::getCMSFields();

$fields->addFieldToTab('Root.Content.Main', new HtmlEditorField('BannerText', 'Testo Intro'));
return $fields;
}
}

class HomePage_Controller extends Page_Controller {
}