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.

Data Model Questions /

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

Tab order in backend


Go to End


5 Posts   3597 Views

Avatar
Stephan

Community Member, 55 Posts

30 June 2009 at 8:01pm

Edited: 30/06/2009 8:10pm

Hi experts,
I'm running 2.3.2 and have created an interface with model admin to edit my data.
I also have a relation "hasmany" with other data.
This works very well.
But I want to change the order of the tabs in the edit area and I don't know how this can be done.

As you can see in the screenshot, I was searching for "Restaurants" (left navigation) .
The result was displayed on the right (edit area), after clicking on the right item, I do get
the attached screen with tab "Rezepte" as the first one.

TIA Stephan

Attached Files
Avatar
zalzadore

Community Member, 20 Posts

31 August 2009 at 11:08am

Stephan,
I haven't tried it but you could remove all the fields from the tab you want last which may remove the tab, then create the tab you want first with its fields, then the tab you want next etc. It looks like you can do this and store the fieldsets in variables with FieldSet functions.

Did you manage to solve this?

Adam.

Avatar
m-phil

Community Member, 37 Posts

11 November 2010 at 11:04pm

Is there currently a way to order tabs?
For addFieldToTab() we have a parameter at the end and with the name of an existing field i.e. 'Content' we can put the new field before the content one.

What about tabs?
Removing and creating the same tabs again for reordering is not efficient.

Avatar
sheadawson

Community Member, 49 Posts

25 November 2010 at 3:35pm

I would also like to find a more efficient way of doing this... Anybody?

Avatar
swaiba

Forum Moderator, 1899 Posts

26 November 2010 at 10:36pm

Well I can offer a very simple method (assuming you are using the scaffolding)...

If you have something like...

	static $has_many = array(
		'RelationA'	=> 'ObjA',
		'RelationB'	=> 'ObjB',
	);

it will show RelationA then RelationB, simply changing the order as defined in the $has_many will change the tab order...

	static $has_many = array(
		'RelationB'	=> 'ObjB',
		'RelationA'	=> 'ObjA',
	);

will show RelationB then RelationA, the same is true of all the fields you define in your dataobject

Hope this helps...