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

renameField has no effect


Go to End


12 Posts   9439 Views

Avatar
Bureau Berg

Community Member, 7 Posts

27 January 2012 at 11:43pm

Working like charm :-) Thanks.

Avatar
Pipifix

Community Member, 56 Posts

16 March 2012 at 5:00am

Hi,

ist much more easier. You dont have to alter the modeladmincode. In your dataobject modell insert the following code.

//Overide the tab labels
static $field_labels = array(
'Content' => 'Other',
'EnglishValue' => 'GermanValue',
);

Known issue: you cannot change 'main' or 'metadata'.

Pipifix

Avatar
botheredbybees

Community Member, 4 Posts

10 May 2013 at 12:09pm

for V3:

$f = parent::getCMSFields();
$f->fieldByName('Root.Main')->setTitle('New Name');

Avatar
neilcreagh

Community Member, 136 Posts

5 May 2015 at 11:57pm

Edited: 05/05/2015 11:58pm

In SS3.1+ this is simply achieved like this

$fields->renameField('Title', 'New Name'); 

Go to Top