New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cslegany/drag-drop-content-types-strapi5

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cslegany/drag-drop-content-types-strapi5

This plugin add a drag and droppable list that allows you to sort content type entries.

  • 0.5.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Strapi plugin drag-drop-content-types

dragdropcrop

Inspired by the Drag-Drop-Content-Type Strapi 4 plugin. Drag-drop feature completely rewritten to use dndkit because react-sortable-hoc is deprecated and not compatible with React 18.

⏳ Installation

Install with NPM.

npm i @cslegany/drag-drop-content-types-strapi5

Install with Yarn.

yarn add @cslegany/drag-drop-content-types-strapi5

🔧 Configuration

In your config

  1. Add the following to your config/plugins.ts file. Create the file, if it doesn't exist.
export default () => ({
  // ...
  'drag-drop-content-types': {
    enabled: true
  }
})
  1. Run npm run build and restart the app using npm run develop.

In the app

  1. Go to SettingsDrag Drop Content TypeConfiguration.
  2. Specify the Rank Field Name used for sorting or leave the default field name rank.
  3. Add a Number field with Name: myRankFieldName and Number format: integer to the sortable ContentType.
  4. Configure the view of your ContentType by adding Default sort attribute → rank and Default sort order → ASC to update the view after dragging.
  5. If needed: grant permissions for the rank field to your roles.
Hints
  • You can set a title value that will be displayed in the menu instead of the default field.
  • A second field can be displayed in the menu via the subtitle setting. It can be either a string-like field or an object such as a relation, that has a title field as configured in the settings.
  • You can enable webhooks to trigger something after updating the order.

In your frontend

You can make a request in the frontend to get the ordered items. In this example the ContentType is called Foo and ordered via the rank field.

http://localhost:1337/api/foo?sort=rank:asc

🤝 Contribute

Feel free to fork and make pull requests to this plugin. All input is welcome - thanks for all contributions so far!

⭐️ Support

I you like this project, please give it a star ⭐️. Maybe this will help it getting integrated to strapi's core some day 😊.

Keywords

FAQs

Package last updated on 07 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc