adds default image width
This commit is contained in:
parent
275e237a5d
commit
412f525d4c
|
@ -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;',
|
||||
]
|
||||
]
|
||||
|
|
|
@ -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]',
|
||||
|
|
|
@ -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'),
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ $this->headLink()->appendStylesheet($this->assetUrl('css/style.css',
|
|||
<img src="<?= $image['media_url'] ?>"
|
||||
alt=""
|
||||
item_url="<?= $image['item_url'] ?>"
|
||||
width="250"
|
||||
width="<?= $width ?>"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue