5099 Posts in 1519 Topics by 1116 members
|Go to End||Next >|
17 October 2012 at 4:53am
Ok I've just finished my first stab at solving this.
I'm working from one limited scenario right now, image attached to data object that's related to a page and just one image/data object.
As long as we're dealing with one image it's a has_one and the field is actually present on the data object which makes it simpler.
However even this has proven to be rather tricky. I think I can get the functionality running on pages rather quickly but I think multi upload is going to be hard. I'm not sure if defining a many_many relationship works before the object is actually created and has an ID.
17 October 2012 at 5:00am
Sounds good MarcusDalgren. Feel free to post your code, either here or on github (fork the project). I will get into the code once I get some free time.
17 October 2012 at 5:02am
Hi, someone wrote a gallery module that deals with these issues:
- multiple upload to gallery
- drag and drop ordering
- adding new image with 1 click
- updating multiple files titles at once
I have tried this image gallery and it works well. check it out
17 October 2012 at 5:06am
Optic Blaze, so does the module let you upload images even before saving/creating the main page?
17 October 2012 at 5:13am
The code I've written so far is available here: https://github.com/raket/sapphire/tree/upload-field-save-on-new
This is still in its early stages so run this on your own risk.
I will have a look at the Image gallery module to see if it actually solves this.
17 October 2012 at 5:31am
Ok I've had a look at the module that handles this (bulk upload) and it does indeed provide a solution.
However the way in which its done does have its risks. If you're using it for bulk creation of DO:s with one image attached (my scenario) it actually creates as many new DO:s as images uploaded. As long as you press Cancel & Delete all you're all good but if you would happen to navigate away from the page in some other way you'll have empty DO:s all over the place.
Not the authors fault per se but it really isn't a good solution. You shouldn't have to pre create objects just in case they get saved.
17 October 2012 at 5:35am
I had a temporary solution that used the same mechanism but the database ended up having lots of empty records.
17 October 2012 at 5:54am
Just had a look at pages and they aren't an issue since pages are created as drafts when you click "Create new". This limits us to DO:s only which is really nice. I haven't tried the multi upload yet but I will be giving that a go tomorrow.
|Go to Top||Next >|