3.0.0 • Published 4 years ago

@globobeet/keystone-cloudinary-gallery-field v3.0.0

Weekly downloads
8
License
MIT
Repository
github
Last release
4 years ago

Keystone Cloudinary Gallery Field

A sortable list of images uploaded to Cloudinary.

Screensot

Usage

You will first need to install the package with your preferred package manager:

yarn add @globobeet/keystone-cloudinary-gallery-field
npm install @globobeet/keystone-cloudinary-gallery-field

Then, you'll need a file adapter (which is also used for CloudinaryImage fields)

const { CloudinaryAdapter } = require('@keystonejs/file-adapters');

const cloudinaryAdapter = new CloudinaryAdapter({
  cloudName: process.env.CLOUDINARY_CLOUD_NAME,
  apiKey: process.env.CLOUDINARY_KEY,
  apiSecret: process.env.CLOUDINARY_SECRET,
  folder: 'my-keystone-app',
});

Then add the field to any list, passing your CloudinaryAdapter instance

const KeystoneCloudinaryGallery = require('@globobeet/keystone-cloudinary-gallery-field');

keystone.createList('Post', {
  fields: {
    photos: {
      type: KeystoneCloudinaryGallery,
      adapter: cloudinaryAdapter,
    },
  },
});