feat(main): Add slider block type

This commit is contained in:
2026-08-25 14:32:21 +02:00
parent 06e98a429b
commit be9a676d9d
28 changed files with 729 additions and 120 deletions
+5
View File
@@ -9,6 +9,11 @@
<strong class="customhtml-alert-title">{$block.title|escape:'html':'UTF-8'}</strong>
{/if}
<span class="customhtml-alert-text">{$block.description|escape:'html':'UTF-8'|nl2br}</span>
{if !empty($block.link)}
<a href="{$block.link|escape:'html':'UTF-8'}" class="btn btn-{$block.alert_type|escape:'html':'UTF-8'} customhtml-alert-btn">
{if !empty($block.link_text)}{$block.link_text|escape:'html':'UTF-8'}{else}{l s='Learn more' d='Modules.Wscustomhtml.Shop'}{/if}
</a>
{/if}
<button type="button" class="close customhtml-alert-close" aria-label="{l s='Close' d='Modules.Wscustomhtml.Shop'}">
<span aria-hidden="true">&times;</span>
</button>
+14 -2
View File
@@ -3,9 +3,21 @@
<div class="customhtml-banner-image--gradient"></div>
{if !empty($block.image_url)}
<img src="{$block.image_url|escape:'html':'UTF-8'}" alt="{$block.title|escape:'html':'UTF-8'}">
{else}
<img
src="{$urls.img_ps_url}noimageavailable.jpg"
alt="{$block.title|escape:'html':'UTF-8'}"
width="100%"
class="img-fluid rounded lazyload"
/>
{/if}
</div>
<div class="customhtml-banner-content">
{include file="module:ws_customhtml/views/templates/hook/_banner_content.tpl" block=$block}
{assign var="customhtmlOverridePath" value="{$smarty.const._PS_THEME_DIR_}modules/ws_customhtml/views/templates/hook/{$hookName}/_banner_content.tpl"}
{if file_exists($customhtmlOverridePath)}
{include file="module:ws_customhtml/views/templates/hook/`$hookName`/_banner_content.tpl" block=$block}
{else}
{include file="module:ws_customhtml/views/templates/hook/_banner_content.tpl" block=$block}
{/if}
</div>
</div>
</div>
+3 -1
View File
@@ -8,5 +8,7 @@
<div class="customhtml-banner-extra-description">{$block.extra_description|escape:'html':'UTF-8'|nl2br}</div>
{/if}
{if !empty($block.link)}
<a href="{$block.link|escape:'html':'UTF-8'}" class="btn btn-primary customhtml-banner-link">{l s='Learn more' d='Modules.Wscustomhtml.Shop'}</a>
<a href="{$block.link|escape:'html':'UTF-8'}" class="btn btn-primary customhtml-banner-link">
{if !empty($block.link_text)}{$block.link_text|escape:'html':'UTF-8'}{else}{l s='Learn more' d='Modules.Wscustomhtml.Shop'}{/if}
</a>
{/if}
+54
View File
@@ -0,0 +1,54 @@
{if !empty($block.slides)}
{if $block.slider_mode == 'responsive'}
{block name=slider_responsive}
<div class="d-lg-none">
<div id="customhtml-slider-{$block.id_ws_customhtml|intval}" class="swiper customhtml-slider" data-swiper="{$block.slider_config|escape:'html':'UTF-8'}">
<div class="swiper-wrapper">
{foreach from=$block.slides item="slide" name="slides"}
<div class="swiper-slide">
{assign var="customhtmlOverridePath" value="{$smarty.const._PS_THEME_DIR_}modules/ws_customhtml/views/templates/hook/{$hookName}/banner.tpl"}
{if file_exists($customhtmlOverridePath)}
{include file="module:ws_customhtml/views/templates/hook/`$hookName`/banner.tpl" block=$slide group=$group hookName=$hookName}
{else}
{include file="module:ws_customhtml/views/templates/hook/_banner.tpl" block=$slide}
{/if}
</div>
{/foreach}
</div>
</div>
</div>
<div class="row d-none d-lg-flex customhtml-slider-grid">
{foreach from=$block.slides item="slide" name="slides"}
<div class="customhtml-slider-grid-item" style="flex: 0 0 {$block.slider_desktop_column_width|escape:'html':'UTF-8'}; max-width: {$block.slider_desktop_column_width|escape:'html':'UTF-8'};">
{assign var="customhtmlOverridePath" value="{$smarty.const._PS_THEME_DIR_}modules/ws_customhtml/views/templates/hook/{$hookName}/banner.tpl"}
{if file_exists($customhtmlOverridePath)}
{include file="module:ws_customhtml/views/templates/hook/`$hookName`/banner.tpl" block=$slide group=$group hookName=$hookName}
{else}
{include file="module:ws_customhtml/views/templates/hook/_banner.tpl" block=$slide}
{/if}
</div>
{/foreach}
</div>
{/block}
{/if}
{if $block.slider_mode != 'responsive'}
{block name=slider_always}
<div id="customhtml-slider-{$block.id_ws_customhtml|intval}" class="swiper customhtml-slider" data-swiper="{$block.slider_config|escape:'html':'UTF-8'}">
<div class="swiper-wrapper">
{foreach from=$block.slides item="slide" name="slides"}
<div class="swiper-slide">
{assign var="customhtmlOverridePath" value="{$smarty.const._PS_THEME_DIR_}modules/ws_customhtml/views/templates/hook/{$hookName}/banner.tpl"}
{if file_exists($customhtmlOverridePath)}
{include file="module:ws_customhtml/views/templates/hook/`$hookName`/banner.tpl" block=$slide group=$group hookName=$hookName}
{else}
{include file="module:ws_customhtml/views/templates/hook/_banner.tpl" block=$slide}
{/if}
</div>
{/foreach}
</div>
</div>
{/block}
{/if}
{/if}
@@ -19,6 +19,11 @@
{include file="module:ws_customhtml/views/templates/hook/_alert.tpl" block=$block}
{elseif $block.type == 'usp'}
{include file="module:ws_customhtml/views/templates/hook/_usp.tpl" block=$block}
{elseif $block.type == 'slider'}
{if $block.show_title && !empty($block.title)}
<div class="customhtml-title">{$block.title|escape:'html':'UTF-8'}</div>
{/if}
{include file="module:ws_customhtml/views/templates/hook/_slider.tpl" block=$block}
{else}
{if $block.show_title && !empty($block.title)}
<div class="customhtml-title">{$block.title|escape:'html':'UTF-8'}</div>