Emil Devantie Brockdorff
Emil Devantie Brockdorff

Reputation: 4954

Drupal: Create own / edit existing CCK field?

First of all, I really like the CCK module and it saves me a lot of time creating forms and fields but with the Upload Image field I’m not happy with the way it presents itself.

I’ve another upload function / layout which uses JavaScript that I would like to have instead but I don’t know how to create the field myself or modify the existing one.

I’ve browsed the module catalogue to see if I could find a module which could give me what I want but haven’t found anything. What I want is something like this: http://valums.com/ajax-upload/ where I just select an image and it is automatically uploaded thus eliminate the use of both an ”select file” button and a ”upload file” button.

Can this be done or would it require a more comprehensive module creation?

Upvotes: 0

Views: 287

Answers (2)

Tamas
Tamas

Reputation: 6420

As far as I understand, you'd like another widget for the filefield. This tutorial is showing you all the steps for creating a custom cck field with custom widgets.

However, I think you are better off with a custom CCK field that in its hook_process defines a form element of type 'markup', and in its '#value' field you can define any HTML content. This content can hold a file input field, and a button with some javascript that uploads the file. And for the upload you could use the AjaxFileUpload jQuery plugin.

Upvotes: 1

Stephane Gosselin
Stephane Gosselin

Reputation: 9148

The image upload module could maybe help you for this.

Upvotes: 0

Related Questions