diff --git a/config/module.config.php b/config/module.config.php index 6f5e5c4..2451a30 100644 --- a/config/module.config.php +++ b/config/module.config.php @@ -21,7 +21,7 @@ return [ 'SmartGalleryBlockForm' => [ 'title' => '', 'renderSourceLink' => true, - 'width' => 600, + 'width' => 200, 'wrapStyle' => 'overflow-y: hidden;display: flex;flex-direction: column;justify-content: center;', ] ] diff --git a/src/Form/SmartGalleryBlockForm.php b/src/Form/SmartGalleryBlockForm.php index 617f33d..4c9eca2 100644 --- a/src/Form/SmartGalleryBlockForm.php +++ b/src/Form/SmartGalleryBlockForm.php @@ -10,6 +10,14 @@ class SmartGalleryBlockForm extends Form public function init() { + $this->add([ + 'name' => 'o:block[__blockIndex__][o:data][width]', + 'type' => Element\Text::class, + 'options' => [ + 'label' => 'Individual image width (px)', + ], + ]); + $this->add([ 'type' => Element\Checkbox::class, 'name' => 'o:block[__blockIndex__][o:data][renderSourceLink]', diff --git a/src/Site/BlockLayout/SmartGallery.php b/src/Site/BlockLayout/SmartGallery.php index 2e5bd6f..f681562 100644 --- a/src/Site/BlockLayout/SmartGallery.php +++ b/src/Site/BlockLayout/SmartGallery.php @@ -48,6 +48,7 @@ class SmartGallery extends AbstractBlockLayout : $this->defaultSettings; $form->setData([ 'o:block[__blockIndex__][o:data][title]' => $data['title'], + 'o:block[__blockIndex__][o:data][width]' => $data['width'], 'o:block[__blockIndex__][o:data][renderSourceLink]' => $data['renderSourceLink'], ]); $form->prepare(); @@ -103,6 +104,7 @@ class SmartGallery extends AbstractBlockLayout 'gallery_id' => 'ig_' . ++$gallery_id, 'title' => $block->dataValue('title'), 'images' => $images, + 'width' => $block->dataValue('width'), 'renderSourceLink' => $block->dataValue('renderSourceLink'), ]); } diff --git a/view/common/block-layout/smartGallery.phtml b/view/common/block-layout/smartGallery.phtml index 4cb81a6..5b7f5b8 100644 --- a/view/common/block-layout/smartGallery.phtml +++ b/view/common/block-layout/smartGallery.phtml @@ -30,7 +30,7 @@ $this->headLink()->appendStylesheet($this->assetUrl('css/style.css',