
Order/arrange items within groups defined by other fields, drag-and drop items ordering: simple order; 2d tiling with variable size; order within multiple rows
released January 22, 2025
npm install group-arrange-strapi-pluginPlugin allows to group content by existing fields and order items within groups. It might be useful for making image galleries, organizing articles, or managing product listings.
There are three types of arrangement supported:
Execute the following npm command in command prompt:
npm install group-arrange-strapi-pluginOr for yarn
yarn add group-arrange-strapi-pluginThis section explain how plugin works.
First page that is open when clicking plugin button. It contains some instructions on how to use the plugin. When collection type is chosen in the left menu, it will open list of available groups under that collection type.

First need to create order field of one of three types:
{x,y,w,h}, for tiled arrangement with variable tile size){row,column}, for arranging items in rows with different amount of items per row)Created field will hold information about configured item position. There could be multiple fields of same type, but with different configuration for columns count or grouping by field.
Different field types have slightly different settings.
city and we have field order that is configured to gooup by field city, and we have items Item 1 (Paris), Item 2 (Berlin), Item 3 (Paris), Item 4 (Paris), then item 1, 3 and 4 will have values of order field 0, 1 and 2, while item 2 will have order value 0.
This is second page of the plugin where user can select group to edit ordering within. List of groups is taken by looking at all the items within chosen collection type. Parentheses display field that is used to group by. When group is selected, user is navigated to the next page to edit the order.

Settings on the top are user-specific and are only saved in localSettings. These fields control how to display items - what field should be image, what should be title and subtitle. These fields are optional and cna be left or set to blank value.

This view is used to order items by drag-and-drop.
Do not forget to Save changes

Allows to arrange items on 2d grid and to set size to items as well. Settings on the top are user-specific and are only saved in localSettings, except for Direction - this one is taken from content type field configuration every time user enters the page.
Do not forget to Save changes

Allows to create new lines and drag-and drop items there. Lines can be reordered or deleted as well using respective buttons. If row is deleted, items return back to Unsorted items. On top panel it's possible to choose displayed columns count for unsorted items, as well as position (top/bottom) of unsorted items list.
Do not forget to Save changes

There is currently just one global setting implemented:

Here is an example of response for GET http://localhost:1337/api/addresses/jqnaatceu6xdub1dnexdzk43. Field categoryOrder is order 1d, location is order 2d and orderMultiline is multiline order field.
{
"data": {
"id": 15,
"documentId": "jqnaatceu6xdub1dnexdzk43",
"postal_code": "FR",
"city": "Marseille",
"json": null,
"slug": null,
"createdAt": "2024-12-26T20:03:48.667Z",
"updatedAt": "2024-12-29T11:22:14.366Z",
"publishedAt": "2024-12-29T11:22:14.362Z",
"location": {
"x": 0,
"y": 0,
"w": 2,
"h": 3
},
"categoryOrder": 2,
"orderMultiline": {
"row": 2,
"column": 1
}
},
"meta": {}
}Please feel free to send your PRs if you'd like to fix/add/improve something!
Share your work with the community and get it listed in the Strapi ecosystem for everyone to discover and use.
Submit
