feat(main: Added default block classes

This commit is contained in:
2026-09-08 16:36:39 +02:00
parent be9a676d9d
commit 620c34e353
29 changed files with 277 additions and 126 deletions
+9 -2
View File
@@ -152,8 +152,11 @@ trait DisplayHooks
} else {
$config['breakpoints'] = [
768 => ['slidesPerView' => (float) $block['slides_per_view_tablet']],
992 => ['slidesPerView' => (float) $block['slides_per_view_desktop']],
];
if ((float) $block['slides_per_view_desktop'] > 0) {
$config['breakpoints'][992] = ['slidesPerView' => (float) $block['slides_per_view_desktop']];
}
}
if ((int) $block['autoplay_delay'] > 0) {
@@ -167,8 +170,12 @@ trait DisplayHooks
return json_encode($config);
}
private function buildSliderDesktopColumnWidth(array $block): string
private function buildSliderDesktopColumnWidth(array $block): ?string
{
if ((float) $block['slides_per_view_desktop'] <= 0) {
return null;
}
$columns = max(1, (int) round((float) $block['slides_per_view_desktop']));
return round(100 / $columns, 4) . '%';
+1
View File
@@ -51,6 +51,7 @@ trait Install
`hook_name` VARCHAR(64) NOT NULL,
`title` VARCHAR(256) NOT NULL DEFAULT \'\',
`custom_class` VARCHAR(128) NOT NULL DEFAULT \'\',
`default_block_class` VARCHAR(128) NOT NULL DEFAULT \'\',
`active` TINYINT(1) NOT NULL DEFAULT 1,
`ordering` INT(11) NOT NULL DEFAULT 0,
`date_add` DATETIME NOT NULL,