Git Product home page Git Product logo

strapi-drag-drop-content-type-plugin's Introduction

Strapi plugin drag-drop-content-types

dragdropcrop

โณ Installation

# with npm
npm i @retikolo/drag-drop-content-types
# with yarn
yarn add @retikolo/drag-drop-content-types

๐Ÿ”ง Configuration

In your config

  1. Add this to your config/plugins.js file (create it, if it doesn't exist yet):
module.exports = {
  // ...
  'drag-drop-content-types': {
    enabled: true
  }
}
  1. Run npm run build and (re)start the app

In the app

Go to Settings -> Drag Drop Content Type -> Configuration:

  • Specify how the rank field is called in your content-types. Default value is rank.
  • Add the rank fields to your content type. With the default value this would be rank (Number (Number format: integer)).
  • (Give permissions for the rank field to roles such as "Editor" if needed).

Hints

  • Add "Default sort attribute" rank, "Default sort order" ASC and remove the rank attribute from the view using "Configure the view" button.
  • You can also set a title value that is displayed in the menu instead of the default.
  • If you want a second field to be displayed in the drag and drop menu, you can add s subtitle in the settings. The subtitle should either be:
  • A field containing a string or number or something like that.
  • It can be an object (like a relation), but it must have the title field specified in the settings (it won't recognize automatically!).

In your frontend

Assuming you go with the default settings, you can make a request on the following url to get the ordered items:

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

๐Ÿž Known issues

Due to changes in the Strapi core, the plugin causes a full page reload after sorting. This is a known issue, and will be fixed ASAP if possible.

๐Ÿค 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 ๐Ÿ˜Š.

strapi-drag-drop-content-type-plugin's People

Contributors

derschiw avatar jpizzle34 avatar campmedia avatar zadinaq avatar kylesierens avatar cedrtang avatar striffly avatar kahrpatrick avatar krzaczek avatar dependabot[bot] avatar kovansky avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.