pods-framework / pods

The Pods Framework is a Content Development Framework for WordPress - It lets you create and extend content types that can be used for any project. Add fields of various types we've built in, or add your own with custom inputs, you have total control.
https://pods.io/
GNU General Public License v2.0
1.07k stars 264 forks source link

Reordering / sorting in pods_ui does not yet work? #1521

Closed basepack closed 11 years ago

basepack commented 11 years ago

Hi all,

I have the following code:

                'orderby' => 'volgorde ASC',
                'reorder' => array(
                        'on' => 'volgorde',
                        'orderby' => 'volgorde ASC',
                ),

Where 'volgorde' means sort_order in Dutch.

I think this code is correct, like it is explained here: http://lowgravity.pl/blog/introduction-to-podscms-2-0-part-2-pods_ui-parameters/ and here: https://github.com/pods-framework/pods/wiki/Custom-Admin-Menu-UI-Example:-Slideshow

Thanks for your support on this one, cannot see why this is not working. I mean of course the drag&drop functionality.

Edit: I have also created a 'volgorde' Plain Number field in the Pod.

basepack commented 11 years ago

I think I made a type or something because everything works now!

piersb commented 9 years ago

I'm also having this problem. Whatever field I try to sort with using orderby in the pods UI, it only sorts by the 'name' field in ascending order.

I can successfully re-order the fields in the pods UI, and using orderby code in the website itself spits them out in the correct order; the only thing that doesn't seem to be working is choosing a field other than name to order by within the UI page.

I've also tried using 'name DESC', but that doesn't do anything either, it's still presenting in 'name ASC'.

  $object->ui = array(
        'orderby' => 'displayorder',
        'title'   => 'Events',
        'reorder' => [  'on' => 'displayorder',
                        'orderby' => 'displayorder',
                        ],
        'reorder_columns' => array(
             'name'      => 'Name',
             'displayorder' => 'Display Order'),
        'columns' => array(
             'displayorder'  => 'Display Order',
             'name'      => 'Name',
             'created'   => 'Date Created',
             'modified'  => 'Last Modified'
             ),
        'add_fields'  => $add_fields,
        'edit_fields' => $edit_fields
        );