Using S3File for images in KeystoneJS

I'd like to know if it's possible, and how much of an effort it would be to use S3File as an image field in KeystoneJS. My testing indicates that while you can indeed upload an image to an S3File, the admin interface treats it as an arbitrary file. The thing I'm missing the most is a preview function like Types.CloudinaryImage provides.

Is the autogenerated admin interface easily extensible without it being ugly hacks? Or is it meant to be left untouched because of the simple fact that it already does so much for you?

Answers


Looks like they intend to improve this.

https://gist.github.com/JedWatson/8519769

https://github.com/JedWatson/keystone/issues/165

My hack solution is to directly edit the keystone template file in node_modules - until these issues are resolved. Edit node_modules/keystone/templates/fields/s3file/form.jade and add wherever you want:

img(src=item.get(field.paths.url))

Then remember to revert this hack after it's officially supported (as updates will blow away the hack).


Need Your Help

Drupal: Extended user forms?

drupal drupal-6

I want to extend user forms in Drupal (to allow them to insert more data, such as Company name, surname, nationality.. etc