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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

All other Modules /

Discuss all other Modules here.

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

Attempting Agile Carousel Module

Go to End

2 Posts   2178 Views


Community Member, 103 Posts

21 November 2009 at 11:14am

I am attempting to build a module for the agile carousel ( This is also the first module I will have written for SilverStripe so I hope I'm not biting off more than I can chew. I started off reading the tutorial that guides you through the randomlinks module, but comments and forum posts lead me to believe that some of these methods are outdated.

I have started to put together classes, and am using ModelAdmin for adding to the CMS (see attached). I'm hoping to gain some understanding of data relationships and using them to make the CMS interface powerful from this thread.

My basic idea for this was to allow for creating slides in the CMS (for now enter html code with text/image). Allow for creating carousels by assigning a title(i.e. home page carousel), and finally letting the user select which slides are included on each carousel. At the moment I am getting an error when I click the create carousel button. "Fatal error: Call to a member function dataFields() on a non-object in C:\website\cs\sapphire\forms\Form.php on line 821"

I'm assuming this is because of a bad relationship. Here is my code so far:


class AgileCarouselAdmin extends ModelAdmin {
    public static $managed_models = array(
    static $url_segment = 'agilecarousel';
    static $menu_title = 'Agile Carousel';

  class Carousel extends DataObject {
    static $db = array (
    'Title' => 'Varchar'
    static $has_many = array(
        'Slides' => 'Slide'

    function getCMSFields_forPopup() {
      $fields = new FieldSet();
      $fields->push( new TextField('Title') );
      return $fields;
    function getCMSfields()  {
        $fields  = parent::getCMSFields();
        $tablefield = new HasOneComplexTableField (
                'Title' => 'Title'

class Slide extends DataObject {
    static $db = array(
        'Title' => 'Varchar',
        'Code' => 'HTMLText'

Expertise, tutorials, references--any help is really appreciated!

Attached Files

Community Member, 107 Posts

24 November 2009 at 4:09am

This is exactly what is needed to improve the looks of a home page. I wish I understood this better, I would help. But it is what is needed. If you get it solved, please post here.