Skip to content

Commit

Permalink
Slider template image alt changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Oksydan committed Jan 6, 2024
1 parent 3d121d1 commit 20fa348
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions views/templates/hook/slider.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,23 @@
<ul class="swiper-wrapper homeslider__list">
{images_block}
{foreach from=$homeslider.slides item=slide}
{$imageAlt = null}

{if $slide.legend}
{$imageAlt = $slide.legend}
{elseif $slide.title}
{$imageAlt = $slide.title}
{/if}

<li class="swiper-slide homeslider__slide">
<a href="{$slide.url}">
{if $slide@first}
<img
class="img-fluid"
class="img-fluid homeslider__img"
src="{$slide.image_url}"
alt="{$slide.title}"
{if $imageAlt}
alt="{$imageAlt}"
{/if}
{if !empty($slide.sizes)}
width="{$slide.sizes.0}"
height="{$slide.sizes.1}"
Expand All @@ -51,7 +61,9 @@
<img
class="img-fluid homeslider__img"
src="{$slide.image_url}"
alt="{$slide.title}"
{if $imageAlt}
alt="{$imageAlt}"
{/if}
{if !empty($slide.sizes)}
width="{$slide.sizes.0}"
height="{$slide.sizes.1}"
Expand Down

0 comments on commit 20fa348

Please sign in to comment.