public function Gallery()
    {
        if ($this->Images()->exists()) {

            // Create a list of images with generated gallery image and thumbnail
            $images = ArrayList::create();
            $pages = $this->PaginatedImages();
            foreach ($this->PaginatedImages() as $image) {
                $image_data = $image->toMap();
                $image_data["GalleryImage"] = $this->GalleryImage($image);
                $image_data["GalleryThumbnail"] = $this->GalleryThumbnail($image);
                $images->add(ArrayData::create($image_data));
            }
            
            $vars = [
                'PaginatedImages' => $pages,
                'Images' => $images,
                'Width' => $this->getFullWidth(),
                'Height' => $this->getFullHeight()
            ];

            return $this->renderWith(
                [
                    'Gallery',
                    'ilateral\SilverStripe\Gallery\Includes\Gallery'
                ],
                $vars
            );
        } else {
            return "";
        }
    }
public function Gallery()
    {
        if ($this->Images()->exists()) {

            // Create a list of images with generated gallery image and thumbnail
            $images = ArrayList::create();
            $pages = $this->PaginatedImages();
            foreach ($this->PaginatedImages() as $image) {
                $image_data = $image->toMap();
                $image_data["GalleryImage"] = $this->GalleryImage($image);
                $image_data["GalleryThumbnail"] = $this->GalleryThumbnail($image);
                $images->add(ArrayData::create($image_data));
            }
            
            $vars = [
                'PaginatedImages' => $pages,
                'Images' => $images,
                'Width' => $this->getFullWidth(),
                'Height' => $this->getFullHeight()
            ];

            return $this->renderWith(
                [
                    'Gallery',
                    'ilateral\SilverStripe\Gallery\Includes\Gallery'
                ],
                $vars
            );
        } else {
            return "";
        }
    }
public function Gallery ( ) { if ( $ this -> Images ( ) -> exists ( ) ) { // Create a list of images with generated gallery image and thumbnail $ images = ArrayList :: create ( ) ; $ pages = $ this -> PaginatedImages ( ) ; foreach ( $ this -> PaginatedImages ( ) as $ image ) { $ image_data = $ image -> toMap ( ) ; $ image_data [ "GalleryImage" ] = $ this -> GalleryImage ( $ image ) ; $ image_data [ "GalleryThumbnail" ] = $ this -> GalleryThumbnail ( $ image ) ; $ images -> add ( ArrayData :: create ( $ image_data ) ) ; } $ vars = [ 'PaginatedImages' => $ pages , 'Images' => $ images , 'Width' => $ this -> getFullWidth ( ) , 'Height' => $ this -> getFullHeight ( ) ] ; return $ this -> renderWith ( [ 'Gallery' , 'ilateral\SilverStripe\Gallery\Includes\Gallery' ] , $ vars ) ; } else { return "" ; } }
Generate an image gallery from the Gallery template, if no images are
available, then return an empty string.

@return string
Generate an image gallery from the Gallery template if no images are available then return an empty string .