Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Edit attributes (name, title...) after uploading file in AssetManager

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2
Go to End
Author Topic: 2395 Views
  • theAlien
    Avatar
    Community Member
    131 Posts

    Re: Edit attributes (name, title...) after uploading file in AssetManager Link to this post

    OK, thanks...
    I'll go through the code conscientiously.

    But... to be sure I'm expecting the right behaviour:

    Does it only enable the has_one deleting of images
    or does it also provide a way to edit the file-attributes from within the dataobject (which is presently my main concern)?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Edit attributes (name, title...) after uploading file in AssetManager Link to this post

    Well, you won't be editing the attributes directly. The attributes are stored in the DataObject that contains the File. So instead of:

    <% control MyFiles %>
    $URL $Title $Description
    <% end_control %>

    It will be

    <% control MyFileObjects %>
    $Title $Description $AltText ... whatever you choose
    $File.URL
    <% end_control %>

    So it's the same thing, you're just storing the attributes on a different table, and they can be anything you want.

  • theAlien
    Avatar
    Community Member
    131 Posts

    Re: Edit attributes (name, title...) after uploading file in AssetManager Link to this post

    Thanks, that's what I thought...

    I guess I have to re-think my sitestructure.
    I was hoping to use the power of the files&images-tab for the main-administrator and some custom uploadforms like subclasses of filefield or the filedataobjectmanager for the regular administrators. But let them both be able to edit at least the copyright-notice (a field added by dataobjectdecorator - since the copyright are quite important when using creative commons-images).

    Since it seems not to be possible (or quite difficult) to edit the file-data anywhere else than in the files&images-tab, I guess I have to (1) follow you're route, (2) create a custom tab with datamodel and (3) in the mean time close the files&images-tab for all types of administrators.

    2395 Views
Page: 1 2
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.