Jump to:

3432 Posts in 1058 Topics by 734 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Tab order in backend

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

Page: 1
Go to End
Author Topic: 2633 Views
  • Stephan
    Avatar
    Community Member
    55 Posts

    Tab order in backend Link to this post

    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
  • zalzadore
    Avatar
    Community Member
    20 Posts

    Re: Tab order in backend Link to this post

    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.

  • m-phil
    Avatar
    Community Member
    37 Posts

    Re: Tab order in backend Link to this post

    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.

  • SheaDawson
    Avatar
    Community Member
    45 Posts

    Re: Tab order in backend Link to this post

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

  • swaiba
    Avatar
    Forum Moderator
    1785 Posts

    Re: Tab order in backend Link to this post

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

    2633 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.