Provides similar functionality to heyday/silverstripe-colorpalette, but uses images rather than colours.
$ composer require iliain/silverstripe-visualfields
$fields->addFieldToTab('Root.Main', $layoutField = VisualOptionField::create('BlockLayout', 'Layout', [
'layout-1' => $layoutFolderPath . '/layout-1.png',
'layout-2' => $layoutFolderPath . '/layout-2.png'
]));
You can customise the size and background colour of the images with the following options:
$layoutField->setOptionWidth('250px');
$layoutField->setOptionHeight('150px');
$layoutField->setOptionBackgroundColour('#f0f0f0'); // Only visible if the image has transparency