What's the best way to deal with a has_many relationship to files or images? I've tried using a complex table field, but it's fairly awkward. You have to save the row before you upload an image, and this is particularly annoying if there is no other data than the image because the row can never get saved. (i.e. Title/Image allows you to save title first, then upload the image after, but what if it's just Image?)
What I want ultimately is to have a random image displayed on every page. I'm wondering what solutions might be out there. Should I be using the Files/Images tab for this? Or can it really be done at the page level?
You could create a folder in the Files Section for the images then use a php function to select a file on random. There is also a HasMany upload form that I believe Andy has created for a project - http://open.silverstripe.com/changeset/46799 - Added a HasManyFile field.. Don't know what state that would be in to use.
Looks like the HasMany file field has a ways to go. If I take your suggestion of using a PHP function to loop through a folder, how would I take advantage of the GD functions that I usually use with my Image objects?
Interesting. So Silverstripe will figure out based on the file extension or mime-type which of those files are images?
I guess my concern is that I want to do a custom cropped resize on these images, and I usually extend the image class to do that by creating a generateMyCrop() function. Where would that fit into this approach?