By cesarpo on
I've been looking at the FAPI reference and didn't found the image upload widget control, there is only a #file and a #managed_file, I've been using the #managed_file, but i'de like the thumb preview functionality.
thanks!
I've been looking at the FAPI reference and didn't found the image upload widget control, there is only a #file and a #managed_file, I've been using the #managed_file, but i'de like the thumb preview functionality.
thanks!
Comments
No one ?
No one ?
I am searching for the same
I am searching for the same solution, although in D6. I found some tutorials for d6, but all of them adivised to copy imagefield widget from some cck field. I don't think it is good solution. I don't want my form field to be depent on some cck field.
Need it too!!!
I'm searching for that too!!!
Do you know how to populate the images' information in a table?! I would like to do something similar to the image upload form.
Any ideas?
I'm looking for the same ..
I'm looking for the same .. will report back when I find a solution.
EDIT: Briefly, the solution I came up with (for Drupal 7) is as follows:
eg. add something like this to your theme array...
eg.
eg.
If all you need is to mimic
If all you need is to mimic the core style then, actually, there is no need to roll your own theme function. Set up the
managed_fileas this:You don't need the
#attacheditem if you don't want the preview to appear floating to the left or you have included the necessary CSS into your own style already.That solution doesn't work
That solution doesn't work for me...
Anyone who has a solution for this issue? It would be great if one could use the normale _multiple_ image upload within form api.
When you say it doesn't work
When you say it doesn't work for you, what do you mean? Do you get an error? Do you get something, but not what you expected? Can you provide examples of your code, or screenshots?
--
Read more at iRolo.net
I just get the normal one
I just get the normal one file upload form item, that I get when I don't use
'#theme' => 'image_widget'
for that item...
No errors, but there is no difference.
I have work example
I have work example
It works, Thanks a lot!
Hey Thanks Aleksey for your code, It works very well.
I am able to upload image and can see the image thumbnail.
But when I refresh that page, the image will gone,
What I need to do for display that image (when refresh the page, after upload) until i delete it.
You can save image in hook
You can save image in hook_submit_form
im my example, I save image in node
change name 'user_identity' on own
Thanks a lot again!
I am using currently - return system_settings_form($form);
So do I need to use submit button code Instead of that?
Or If you know what to use with system_settings_form, than please guide me!
Thanks my dear :) I try this code.
hello, I use simple - return
hello, I use simple - return $form; in hook_form. You can see my previuos comment with hook_form
I need to use system_settings
I need to use system_settings_form only,
because we dont want nodes, we just want to save values in variables.
Following code works for me, hope it helps someone
// in from builder function// managed file elements process callback// elements pre render callbackNice. Our forum software is
Nice. Our forum software is ancient and outdated, so I can't thumbs-up your post, but this is the next best thing.
Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
Our forum is great place for
Our forum is great place for drupal discussion, sharing knowledge, gaining information, solving problem, exploring drupal...etc.
This is the great & vast network of drupal developers.
if this is outdated than where should we discuss, please suggest!
The community is great - it's
The community is great - it's the actual forum software that sucks.
Here is ok, but you're more likely to find an answer on drupal.stackexchange.com, due to them having a modern software that properly handles programming style questions.
Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
Or try slack
See https://www.drupal.org/slack
Thanks mmjvb,
Thanks mmjvb,
But in my opinion, rather than many groups, The one vast group is better. so on the same place we can meet with all experts.
that's why i was preferred the drupal.org group. (all people on same place to discuss, and not need to post/search on different-2 communities)
Not sure what you are talking about, sounds off topic!
Anyway, you are not going to meat too many experts here. Which is why I pointed to slack, not saying not to use the forum!
Suggest to see the documentation on where to find the community, there are more places then are mentioned here.
@mmjvb bro, Thanks for
@mmjvb bro, Thanks for suggesting more communities,
Thanks for the feedback
@Jaypan, Glad to know that you liked it :) & thanks for the positive feedback.. My Salutes to your contributions in Drupal :).... I wish i can also contribute back to the community, at-least a small percentage of what you have done...
Updated for 2022
This was _very_ helpful for me, thank you. This page kept coming up first in my googling so I thought I would share the solution I'm using with Drupal 9 here: https://gist.github.com/jennatollerson/fcd5177476b6c7ab92ca1e3c1140be9c
I hope this helps someone. :)