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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

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

Saving files with uploadfield into a child relation


Go to End


3 Posts   889 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.