How can I add multiple images to a gallery at once?

I have uploaded a large number of photos to a asset folder. I would like to save this folder as a gallery object (data component: image gallery).
I don’t want to drag and drop photos one by one, I want to add several photos at the same time. Is this possible and how does it work?

Thanks a lot

Hi,
not yet possible, but would be a nice feature. We’re happy to merge PRs for that :slight_smile:

BR
Christian

Christian, having such a feature would be really great. We solved our current problem with PHP. We read all images from an asset folder and generate a gallery (fixed title) via URL call . We used the code example from “Populate an ImageGallery” from the Pimcore docu as basis. https://pimcore.com/docs/5.x/Development_Documentation/Objects/Object_Classes/Data_Types/Image_Types.html

	public function galleryFromAssetsAction(Request $request) {

		$list = new \Pimcore\Model\Asset\Listing();
		// Path to our asset folder
		$list->setCondition("path LIKE :path", ["path" => "%/Galleries/Formgallery/"]);
		$list->setLimit('50');
		$list->load();

		// Create new Object wich contains the ImageGallery
		$ourgallery = new DataObject\Gallerie();
		// We set here a fixed object/gallery name
		$ourgallery->setKey('Formgallery-1');
		// Folder ID where the gallery will be saved 
		$ourgallery->setParent(DataObject\AbstractObject::getById('250'));
		$ourgallery->setPublished(true);

		$galleryData = $list;

		$items = [];
		foreach($galleryData as $img){

		$advancedImage = new \Pimcore\Model\DataObject\Data\Hotspotimage();
		$advancedImage->setImage($img);
		$items[] = $advancedImage;
		}

 		$ourgallery->setImagegallery(new \Pimcore\Model\DataObject\Data\ImageGallery($items));
		$ourgallery->save();
		
		$response = new Response();
		$response->setContent('<h1>Gallery created</h1>');
		return $response;

	}

}

Thanks for your interest.

Hi, i thought I already created a PR for that and it was merged. It did not work on folder drag and drop I think but did work when you selected multiple images in the tree (shift or ctrl) and dropped them into the gallery.
If I didn’t I can create the PR.