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.

General Questions /

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

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


Reply


375 Views

Avatar
borriej

Community Member, 267 Posts

14 December 2012 at 6:37am

Edited: 14/12/2012 6:39am

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(?)