Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » 'Content' field in Files

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 1677 Views
  • Mat Weir
    Avatar
    Community Member
    33 Posts

    'Content' field in Files Link to this post

    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

  • e-scape
    Avatar
    Community Member
    16 Posts

    Re: 'Content' field in Files Link to this post

    -- 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

  • Mat Weir
    Avatar
    Community Member
    33 Posts

    Re: 'Content' field in Files Link to this post

    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.

    1677 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.