Jump to:

791 Posts in 369 Topics by 303 members

Widgets

SilverStripe Forums » Widgets » Slideshow widget

Discuss SilverStripe Widgets.

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

Page: 1 2
Go to End
Author Topic: 4391 Views
  • jpmcc
    Avatar
    Community Member
    14 Posts

    Re: Slideshow widget Link to this post

    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!

  • bartvanirsel
    Avatar
    Community Member
    88 Posts

    Re: Slideshow widget Link to this post

    thanks! old topic but it really helped me out!

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