Skip to content
This repository has been archived by the owner on Jan 25, 2021. It is now read-only.

Structure field: adds sort & flip option, fix #722 #749

Closed
wants to merge 6 commits into from
Closed

Structure field: adds sort & flip option, fix #722 #749

wants to merge 6 commits into from

Conversation

distantnative
Copy link

Adds a sort and flip option for structure fields (fixes #722 and #652 )

  structurefield:
    label: Structure with sort and flip
    type: structure
    sort: ordernumber
    flip: true
    fields:
      a:
        label: A
        type:  text
      b:
        label: B
        type: text
      ordernumber:
        label: Order no
        type: number

Update:
Also works with multiple sort fields and sort direction:

sort: fieldone, asc, fieldtwo, desc

More changes to do

  • Disable manual sorting when sort field is set (it won't sort it anyway, but dragging will seem like you could)
  • Order in file is staying the same atm - a problem?

Adds a `sort` and `flip` option for structure fields

```php
structurefield:
    label: Structure with sort and flip
    type: structure
    sort: ordernumber
    flip: true
    fields:
      a:
        label: A
        type:  text
      b:
        label: B
        type: text
      ordernumber:
        label: Order #
        type: number
```
@distantnative distantnative changed the title Structure field: adds sort & flip option, fix #722 [WIP] Structure field: adds sort & flip option, fix #722 Feb 6, 2016
@distantnative distantnative changed the title [WIP] Structure field: adds sort & flip option, fix #722 Structure field: adds sort & flip option, fix #722 Feb 6, 2016
@distantnative
Copy link
Author

Ok ready to be considered

@lukasbestle
Copy link
Member

I think it should also be unsortable when flip is enabled.

Nico Hoffmann added 3 commits February 6, 2016 15:21
Now also works with multiple sort fields and sort direction:

```
sort: fieldone, asc, fieldtwo, desc
```
@gerardkd
Copy link

gerardkd commented Apr 30, 2016

Any idea when this is going to be implemented (I don't see a Milestone attached yet)? I'm eager to have this in one of my projects :).

@texnixe
Copy link

texnixe commented Apr 30, 2016

I don't know for sure but I guess it's probably not going to make it into 2.3 anymore. You could make a copy of the structure field with the changes of the pull request and put it into /site/fields to overwrite the original structure field.

@texnixe
Copy link

texnixe commented Jul 2, 2016

I'd like to push this up again. Would be great if this feature would be integrated into the structure without modal ...

@lukasbestle lukasbestle modified the milestones: 2.5, 2.5.0, Future Jun 12, 2017
@lukasbestle lukasbestle self-assigned this Jun 18, 2017
lukasbestle added a commit that referenced this pull request Jun 18, 2017
@lukasbestle
Copy link
Member

I have implemented this on the develop branch because the original PR wasn't auto-mergable. I did some refactoring on the way. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants