Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Saving files with uploadfield into a child relation


Go to End


3 Posts   645 Views

Avatar
Bambii7

Community Member, 254 Posts

12 December 2012 at 12:22am

Hi guys,

I'm wanting/wondering if I can use the upload field on a parent object to save into a child object's image relation.

I have an ItemPage which has_many StoryItem which has_one Image
There are a few optional fields in StoryItem, so for simplicty I would like the awesome upload field on the ItemPage to drag and drop into.

I tried supplying Stories.Image as the $name when creating new UploadField(), no go though. Am I dreaming?

Using gridfield is fine too, just not quite as fast.

Avatar
zenmonkey

Community Member, 545 Posts

12 December 2012 at 5:06am

I'm currently in the process of upgrading a site from 2.4 to 3 where I had a working solution. I'll keep you posted as I should be tackling that section this week

Avatar
Bambii7

Community Member, 254 Posts

12 December 2012 at 12:31pm

ty zenmonkey, I'll here update if I get any closer to achieving this.