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

Renaming and sort order of tabs (like main)


Go to End


3 Posts   2476 Views

Avatar
Pipifix

Community Member, 56 Posts

16 March 2012 at 6:00am

Hello again.

I want to rename and sort the given structure of the dataobject tabs.
The dataobject got several tabs (main, adress, metadata, contactperson, usage,house). I used this code to rename(translate).

//Overide the tab labels in ModellAdmin
	static $field_labels = array(
		'Main' => 'Objektdaten',
		'Adress' => 'Adresse',
		'Usage' => 'Nutzung',
		'House' => 'Hausdaten',
		'Contactperson' => 'Ansprechpartner',
		'Metadata' => 'System'
	);

But I'm not able to rename 'Main' and 'Metadata' and the order of the tabs is not affected. How to get this done?

Thanks for you help. Pipifix.

Avatar
swaiba

Forum Moderator, 1899 Posts

16 March 2012 at 6:13am

I'm going to disagree with moving the main tab - but that is my preference I guess.

The simplest way to re-order tabs that are scafollded is to change the order they are defined in the has_one/has_many/many_many.
Other than that I'd remove the tab and then add it again in the order I'd like.

I think I have tried the re-order and it didn't work out for me.

Avatar
Pipifix

Community Member, 56 Posts

16 March 2012 at 7:25am

Oh, thats what i call a fast reply. Thanks.

But i can actually not change the order they are defined. Main and metadata are populated by the databjects-as-pages-module, adress is populated by the the adressable-module. The rest is by my own scaffolding.
It was a wish of my client (a little bit oldfashioned guy) to rename the main tab. i guess have to 'advice' him to leave it well alone.

For the order I'll give the remove/add-thing a try.

Greetings from germany. Pipifix