I am using Strapi CMS to manage a list of entries inside a repeatable component. When I click "Add an entry", the new item always gets added to the bottom of the list. However, I want it to be inserted at the top instead or to make the list automatically sortable according to one of the field i have in content.
Is there a way to modify Strapi’s default behavior to add new entries at the beginning of the list? Any workaround (e.g., modifying the admin panel settings, custom JS override, or backend logic) would be appreciated.
This the code which has the schema to add Content in the Spotlight Page Card
This is how it looks on the CMS panel
This the Content type of how it looks in admin panel
export interface ApiSpotlightPageSpotlightPage extends Schema.SingleType {
collectionName: 'spotlight_pages';
info: {
singularName: 'spotlight-page';
pluralName: 'spotlight-pages';
displayName: 'Spotlight Page';
description: '';
};
options: {
draftAndPublish: true;
};
attributes: {
hero_banner: Attribute.Component<'section.banner'>;
categories: Attribute.Component<'ui.category', true>;
cards: Attribute.Component<'ui.spotlight-item', true>;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
publishedAt: Attribute.DateTime;
createdBy: Attribute.Relation<
'api::spotlight-page.spotlight-page',
'oneToOne',
'admin::user'
> &
Attribute.Private;
updatedBy: Attribute.Relation<
'api::spotlight-page.spotlight-page',
'oneToOne',
'admin::user'
> &
Attribute.Private;
sitemap_exclude: Attribute.Boolean &
Attribute.Private &
Attribute.DefaultTo<false>;
};
}