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.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

'Content' field in Files


Go to End


3 Posts   2043 Views

Avatar
Mat Weir

Community Member, 33 Posts

13 August 2009 at 11:48am

Edited: 13/08/2009 11:49am

Hey guys,

I'm trying to use the 'Content' field on File because it's editable in Files & Images with DataObjectManager installed. Basically I want to use it as a caption field for images.

But I'm having trouble access that Content field because instance_get is overridden in File.php to remove the Content field.

Does anyone know how to easily access the Content field on File? $File->Content and $File->getField('Content') both fail.

Cheers

Avatar
Quadra

Community Member, 16 Posts

10 December 2009 at 2:02am

Edited: 10/12/2009 2:22am

-- OK so I worked out that the quickest way was to add an extension to the File class adding a Summary field.. worked a treat

Mat,

Did you ever sort out how to deal with this problem, I am looking at doing exactly the same thing...

Thanks
Jason

Avatar
Mat Weir

Community Member, 33 Posts

10 December 2009 at 9:37am

No I didn't work out how to access the Content attribute.

Instead I usually create a Photo object that has Title and Description fields and a has_one Image.