code/CarouselPage.php
public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        $field = SortableUploadField::create('Images', _t('CarouselPage.db_Images'));
        $field->setFolderName($this->getClassFolder());
        $field->setFileEditFields('getCarouselEditFields');

        $root = $fields->fieldByName('Root');
        $tab = $root->fieldByName('Images');
        if (! $tab) {
            $tab = Tab::create('Images');
            $tab->setTitle(_t('CarouselPage.db_Images'));
            $root->insertAfter($tab, 'Main');
        }
        $tab->push($field);

        return $fields;
    }
public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        $field = SortableUploadField::create('Images', _t('CarouselPage.db_Images'));
        $field->setFolderName($this->getClassFolder());
        $field->setFileEditFields('getCarouselEditFields');

        $root = $fields->fieldByName('Root');
        $tab = $root->fieldByName('Images');
        if (! $tab) {
            $tab = Tab::create('Images');
            $tab->setTitle(_t('CarouselPage.db_Images'));
            $root->insertAfter($tab, 'Main');
        }
        $tab->push($field);

        return $fields;
    }
public function getCMSFields ( ) { $ fields = parent :: getCMSFields ( ) ; $ field = SortableUploadField :: create ( 'Images' , _t ( 'CarouselPage.db_Images' ) ) ; $ field -> setFolderName ( $ this -> getClassFolder ( ) ) ; $ field -> setFileEditFields ( 'getCarouselEditFields' ) ; $ root = $ fields -> fieldByName ( 'Root' ) ; $ tab = $ root -> fieldByName ( 'Images' ) ; if ( ! $ tab ) { $ tab = Tab :: create ( 'Images' ) ; $ tab -> setTitle ( _t ( 'CarouselPage.db_Images' ) ) ; $ root -> insertAfter ( $ tab , 'Main' ) ; } $ tab -> push ( $ field ) ; return $ fields ; }
Add the "Images" tab to the content form of the page.

The images are linked to the page with a many-many relationship,
so if an image is shared among different carousels there is no
need to upload it multiple times.

@return FieldList
Add the Images tab to the content form of the page .