Jump to:

23368 Posts in 18143 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » Best way of adding title/description to an image in SS 3

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 293 Views
  • borriej
    Avatar
    Community Member
    267 Posts

    Best way of adding title/description to an image in SS 3 Link to this post

    Hi,

    Im strugling, i want to create a set of images with a title and description , for instance on my blog entry's.

    Requirements:
    - It should be easy/ quick
    - users must be able to choose images from the assets folder
    - multiple image selection
    - Add title/descriptions to them
    - sortable order using drag & drop

    it used to work quite easy, i would select all my images in the dataobjectmanager, e.g. 4 images.. and a popup would appear, and I would enter the title/description for al of them. Save.. done..

    I have tried the bulkUpload way with a dataobject (BlogImages)

       $gridFieldConfig = GridFieldConfig_RecordEditor::create()
             ->addComponent(new GridFieldBulkEditingTools())
             ->addComponent(new GridFieldBulkImageUpload())
             ->addComponent(new GridFieldSortableRows('SortOrder'));
          
          $gridField = new GridField(
             'BlogImages',
             'Blog Images',
             $this->owner->BlogImages()->sort('SortOrder'),
             $gridFieldConfig
          );
          
          $fields->addFieldToTab('Root.Images', $gridField);

    - but then i have the downside of a dataobject that i have to save first before i can upload an image, this is not easy, confusing for clients
    - also i dont like the fact the editing opens in a new (almost full screen) window, a pop-up would be good enough. Now i have to return to my page using the breadcrumbs..

    What is best practice?

    also tried uploadfield and sortableUploadField, but cant add dataobjects (for the description) to them(?)

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