feat(main): Introduce USP block type and custom classes for HTML groups
This release adds a new "USP" (Unique Selling Proposition) block type, allowing for flexible display of image-based selling points with optional links. Additionally, administrators can now assign custom CSS classes to Custom HTML Groups, enhancing layout and styling capabilities. Includes a refinement to the FAQ accordion template to ensure questions without answers do not display a collapse button, improving usability. Updates module version to 1.13.0 with a database upgrade script for the new `custom_class` column.
This commit is contained in:
@@ -69,7 +69,7 @@ trait DisplayHooks
|
||||
|
||||
$blocksByGroup = CustomHtmlBlock::getActiveByGroupIds(array_column($groups, 'id_ws_customhtml_group'));
|
||||
$blocksByGroup = $this->attachFaqsToBlocks($blocksByGroup);
|
||||
$blocksByGroup = $this->attachBannerImageUrls($blocksByGroup);
|
||||
$blocksByGroup = $this->attachImageUrls($blocksByGroup);
|
||||
|
||||
$groups = array_map(static function (array $group) use ($blocksByGroup) {
|
||||
$group['blocks'] = $blocksByGroup[(int) $group['id_ws_customhtml_group']] ?? [];
|
||||
@@ -95,11 +95,11 @@ trait DisplayHooks
|
||||
}, $blocksByGroup);
|
||||
}
|
||||
|
||||
private function attachBannerImageUrls(array $blocksByGroup): array
|
||||
private function attachImageUrls(array $blocksByGroup): array
|
||||
{
|
||||
return array_map(static function (array $blocks) {
|
||||
return array_map(static function (array $block) {
|
||||
if ($block['type'] === 'banner') {
|
||||
if (in_array($block['type'], ['banner', 'usp'], true)) {
|
||||
$block['image_url'] = CustomHtmlBlock::getBannerImageUrl($block['image']);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user