Change the sort order of users in the panel?

I’d like to know if it’s possible to do the following on the Users page in the panel…

  • flip the sort order?
  • change sorting from based on alphabetical order to based on date created?

Thanks. :slight_smile:

The features you requested are both possible and can be set in the pages section of the blueprint of the parent page.

The order can be defined by the sort attribute by setting if to sort: flip.
The type of numbering can be defined by the numbering attribute.

For details, please take a look at the documentation of the panel blueprints:
https://getkirby.com/docs/panel/blueprints/subpages-settings
Especially the “Reverse sorting of subpages” and “Numbering of subpages” sections.

No, it’s unfortunately not possible with user configuration. What @jbeyerstedt is referring to is flipping and sorting subpages, but it doesn’t work with users as there is no users blueprint.

The only way I see is to change this line in the Panel code. You can add all kind of sorting there, $users is just the users collection.

@jbeyerstedt Thanks for response. :slight_smile: But I’m wanting to sort the Users page in the panel.

Sorry, it somehow skipped the important part of your question. But Lukas has the correct answer for you.

Thanks @lukasbestle. I’ll do that as a short term fix. :slight_smile:

From the docs, it seems you can add a users blueprint to manage user fields.

Since Kirby 2.4.0, you can define a default user blueprint in site/blueprints/users/default.yml, which will be used if no role-specific blueprint has been defined.

It’d be nice if we could manage how users are displayed in the list page as well from a default users blueprint.

I didn’t word it very well. I edited the original post. Hopefully it’s more clear now. Thanks!

User blueprints, yes. They are used for the user fields. But there is no users blueprint. Apart from sorting I don’t think that there would be a use-case for a users blueprint though. The index page does not have fields after all.

Just as a note, the datatables plugin (while working) is no longer maintained - I recommend using https://github.com/LCD344/Kirby-userManager-panel-extention instead.

1 Like