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.

Customising the CMS /

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

Translation of their own fields


Go to End


1619 Views

Avatar
BangMan

Community Member, 7 Posts

18 April 2009 at 2:12am

I created its type of the page:

/**
* Defines the NewsPage page type
*/
class NewsPage extends Page {

static $db = array(
'Date' => 'Date',
);

static $has_one = array(
'Photo' => 'Image',
);

As I can translate into russian language in Admin Panel this Fields: Date and Photo

static $icon = "/themes/tutorial/images/treeicons/news";
function getCMSFields() {
$fields = parent::getCMSFields();

$fields->addFieldToTab('Root.Content.Main', new CalendarDateField('Date'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new ImageField('Photo'), 'Content');

return $fields;

function fieldLabels() {
$labels = parent::fieldLabels();

$labels['Date'] = _t('NewsPage.DATE', "Val News Date");

return $labels;
}
}

}

class NewsPage_Controller extends Page_Controller {

}

?>

Attached Files