Allow admins to order relationship fields with drag-and-drop #4068
Replies: 3 comments 4 replies
-
@Snailedlt can you achieve this using |
Beta Was this translation helpful? Give feedback.
-
This is a standard feature in any CMS, hope it is added asap; now that v3 is rockin. Drupal has a button to reset to alphabetical which is bonus. gg |
Beta Was this translation helpful? Give feedback.
-
I forgot to mention, but the current workaround that I'm using is to have an array wrapping the relationship field, like so: {
name: "tags",
labels: {
singular: "Tag",
plural: "Tags",
},
type: "array",
maxRows: 10,
fields: [
{
name: "tag",
type: "relationship",
relationTo: Tag.slug,
required: true,
},
],
}, Not ideal, especially because it adds another layer of depth, but it works for now. |
Beta Was this translation helpful? Give feedback.
-
What?
Currently there's no way for admins to order the options in a hasMany relationship field. It would be nice if they could order the relationships by for example drag-and-drop. Perhaps ordering could be a new attribute
orderable
,admin.orderable
oradmin.dragAndDropOrdering
which is just a boolean?Why?
This might be useful for things like tags, where you'd want, say 10 tags... but in the frontend you'd only want to display 4 of them. The admin would like to control which 4 are displayed, so having them ordered by priority would be an easy way to allow that.
Beta Was this translation helpful? Give feedback.
All reactions