Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

ratecity/keystone-custom-fieldtypes

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPM version Build Status Dependency Status

keystone-custom-fieldtypes

A minimal module copying custom keystone field types from any directory into keystone.

Works on Keystone.js 0.3.x

Installation

From your keystone project's root:

  npm install keystone-custom-fieldtypes --save

Usage

In your project's keystone.js file before keystone.init call:

  var kcf = require('keystone-custom-fieldtypes');

  kcf.loadFromDir('path');

Note If no dir was specified, will try to load from '/fieldTypes'

Example Dir Structure

fieldTypes
    ├───custom
           CustomField.js
           CustomType.js
    
    ├───foo
           BarField.js
           BarType.js
    
    └───secondcustom
            SecondCustomField.js
            SecondCustomType.js

Dir names not need to have any relavence to the actual type name (ex: foo)

Warning:

Pay Attention : using this module assumes that all the custom fields inside your custom fields dir are on current keystone's format. Use the same pattern as in keystone's fields\types dir. Give each of your types its own dir, {field}Type.js file and {filed}Field.js file

License

MIT © kadosh1000

About

Allow adding custom fieldtypes to keystone project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%