Skip to content

Commit

Permalink
DOC Document new TabSet::changeTabOrder() method.
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Aug 8, 2024
1 parent 7ab3f1f commit 9c5801a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions en/02_Developer_Guides/03_Forms/06_Tabbed_Forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ $fields->addFieldsToTab('Root.Content', [
]);
```

## Change the order of tabs

If you need to change the order of tabs, for example if the tabs were scaffolded through [`FormScaffolder`](api:SilverStripe\Forms\FormScaffolder),
you can do so by passing the correct order of the tabs into [`TabSet::changeTabOrder()`](api:SilverStripe\Forms\TabSet::changeTabOrder()).

If there are more tabs in the tab set than you include in the tab order, they will be added after the tabs you explicitly included.

```php
$fields->fieldByName('Root')->changeTabOrder(['FirstTab', 'SecondTab']);
```

## API documentation

- [FormScaffolder](api:SilverStripe\Forms\FormScaffolder)
1 change: 1 addition & 0 deletions en/08_Changelogs/5.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ From 6.0 onwards, tokens will never be regenerated during session renewal, and t
- `silverstripe/graphql-devtools` contains a new `GraphQLSchemaInitTask` to help you initialise a basic GraphQL schema.
- [`GridFieldDetailForm_ItemRequest`](api:SilverStripe\Forms\GridField\GridFieldDetailForm_ItemRequest) now uses a [`PjaxResponseNegotiator`](api:SilverStripe\Control\PjaxResponseNegotiator) to handle PJAX responses for the save and publish actions. This aligns it with responses from other form submissions in the CMS.
- Primitive types inside an iterable object will now be automatically converted to relevant [`DBField`](api:SilverStripe\ORM\FieldType\DBField) types so can be rendered in a template. This allows the use of `return ArrayList::create(['lorem', 123]);` from a [`ContentController`](api:SilverStripe\CMS\Controllers\ContentController) method that is then looped over in a template.
- A new [`TabSet::changeTabOrder()`](api:SilverStripe\Forms\TabSet::changeTabOrder()) method has been added that allows you to change the order of tabs in a `TabSet`. See [tabbed forms](/developer_guides/forms/tabbed_forms/#change-the-order-of-tabs) for details.

## API changes

Expand Down

0 comments on commit 9c5801a

Please sign in to comment.