Skip to content

Added option random_cb for images in edit fields#930

Open
niahoo wants to merge 1 commit intoFrozenNode:devfrom
niahoo:dev
Open

Added option random_cb for images in edit fields#930
niahoo wants to merge 1 commit intoFrozenNode:devfrom
niahoo:dev

Conversation

@niahoo
Copy link
Copy Markdown

@niahoo niahoo commented Oct 7, 2015

Hi,

this is a small addition to let the developer generate image names.

I wanted to add a function possible value to the naming option and add a naming_cb option, but this requires some refactoring to keep the code clean*.

So, this just adds the possibility to provide a callback, but it is of-course not mandatory for the callback to provide actual-random names. (md5 of the file content is what I personnally do !).

Also if you like this and would rather set the defaults-options/rules in the Field\File class, just tell me.

(* I wish that Multup does not generate names by itself, only using the callbacks it's given or a name (string) it's given.)

…to provide a callback to generate the random name.
@niahoo
Copy link
Copy Markdown
Author

niahoo commented Oct 27, 2015

Hi, could you tell me if you're interested or not ?

@davemathews
Copy link
Copy Markdown
Contributor

@niahoo I'm interested just trying to decide the full need v/s if this is the best way.

@niahoo
Copy link
Copy Markdown
Author

niahoo commented Oct 29, 2015

The full need is to be able to specify the file name with a function. The best thing to do imho is to allow a function as a value for the naming option.

I can code that if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants