Skip to content

Commit 813304d

Browse files
authored
Merge pull request #654 from Hlavtox/prepare-thumbnails
Use new way to access category images
2 parents 9b81ed2 + 60fcfee commit 813304d

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

templates/catalog/_partials/category-header.tpl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
{if $category.description}
1010
<div id="category-description" class="rich-text mb-4">{$category.description nofilter}</div>
1111
{/if}
12-
{if !empty($category.image.large.url)}
12+
{if !empty($category.cover.large.url)}
1313
<div class="category-cover mb-4">
14-
<img src="{$category.image.large.url}"
15-
alt="{if !empty($category.image.legend)}{$category.image.legend}{else}{$category.name}{/if}"
14+
<img src="{$category.cover.large.url}"
15+
alt="{if !empty($category.cover.legend)}{$category.cover.legend}{else}{$category.name}{/if}"
1616
fetchpriority="high"
1717
class="img-fluid"
18-
width="{$category.image.large.width}"
19-
height="{$category.image.large.height}">
18+
width="{$category.cover.large.width}"
19+
height="{$category.cover.large.height}">
2020
</div>
2121
{/if}
2222
</div>

templates/catalog/_partials/subcategories.tpl

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,21 @@
1111
<div class="subcategory__wrapper col-6 col-lg-4 col-xl-3">
1212
<a class="subcategory" href="{$subcategory.url}" title="{$subcategory.name|escape:'html':'UTF-8'}">
1313
<div class="subcategory__image">
14-
{if !empty($subcategory.image.small.url)}
14+
{if !empty($subcategory.thumbnail.small.url)}
1515
<img
1616
class="img-fluid"
17-
src="{$subcategory.image.small.url}"
18-
width="{$subcategory.image.small.width}"
19-
height="{$subcategory.image.small.height}"
17+
src="{$subcategory.thumbnail.small.url}"
18+
width="{$subcategory.thumbnail.small.width}"
19+
height="{$subcategory.thumbnail.small.height}"
20+
alt="{$subcategory.name|escape:'html':'UTF-8'}"
21+
loading="lazy"
22+
>
23+
{else}
24+
<img
25+
class="img-fluid"
26+
src="{$urls.no_picture_image.small.url}"
27+
width="{$urls.no_picture_image.small.width}"
28+
height="{$urls.no_picture_image.small.height}"
2029
alt="{$subcategory.name|escape:'html':'UTF-8'}"
2130
loading="lazy"
2231
>

0 commit comments

Comments
 (0)