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.

Widgets /

Discuss SilverStripe Widgets.

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

Slideshow widget

Go to End

10 Posts   6393 Views


Community Member, 20 Posts

10 November 2011 at 6:34am

This is exactly what I was looking for. Just a few tweaks:

$options = array();

I changed to :

$options = '<option value="0">Please select an image</option>';

to provide an empty selection, otherwise the first image is already selected, and if it was saved, potentially the wrong image would be saved.

Also just to note that when adding the field to the widget, the image field ID should be specified, so if:

//My Widget

static $has_one = array(
    'MyWidgetImage' => 'Image'

//when adding the field

$widgetImageField = new WidgetImageField('MyWidgetImageID', 'My Widget Image');

Cheers for sharing this!


Community Member, 96 Posts

20 January 2012 at 10:11pm

thanks! old topic but it really helped me out!

Go to Top