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.

Data Model Questions

Tab order in backend


5 Posts   2670 Views


30 June 2009 at 8:01pm (Last edited: 30 June 2009 8:10pm), Community Member, 55 Posts

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

31 August 2009 at 11:08am Community Member, 20 Posts

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?



11 November 2010 at 11:04pm Community Member, 37 Posts

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.


25 November 2010 at 3:35pm Community Member, 46 Posts

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


26 November 2010 at 10:36pm Forum Moderator, 1796 Posts

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...