An open API service indexing awesome lists of open source software.

https://github.com/a2nt/silverstripe-treemultiselect-sortable-field

SilverStipe custom sort field on tree items
https://github.com/a2nt/silverstripe-treemultiselect-sortable-field

Last synced: 10 months ago
JSON representation

SilverStipe custom sort field on tree items

Awesome Lists containing this project

README

          

# silverstripe-treemultiselect-sortable-field

# SilverStripe Tree Multi-select sortable field

SilverStipe custom sort field on tree items

## Installation

```
composer require a2nt/silverstripe-treemultiselect-sortable-field
```

## Usage

- Install the module, run dev/build
- Add your custom field

```
private static $many_many = [
'FooterNavigation' => SiteTree::class,
];

private static $many_many_extraFields = [
'FooterNavigation' => [
'SortOrder' => 'Int',
],
];

TreeMultiselectFieldSortable::create(
'SortOrder', // order field name
'FooterNavigation', // relation name
'Footer Navigation', // field title
SiteTree::class // relation objects class name
)
```

![alt text](screenshot.png 'Click to an item and move it using arrows at the left and right')