Skip to content

Commit

Permalink
Merge pull request #654 from Hlavtox/prepare-thumbnails
Browse files Browse the repository at this point in the history
Use new way to access category images
  • Loading branch information
Hlavtox authored Sep 17, 2024
2 parents 9b81ed2 + 60fcfee commit 813304d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
10 changes: 5 additions & 5 deletions templates/catalog/_partials/category-header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
{if $category.description}
<div id="category-description" class="rich-text mb-4">{$category.description nofilter}</div>
{/if}
{if !empty($category.image.large.url)}
{if !empty($category.cover.large.url)}
<div class="category-cover mb-4">
<img src="{$category.image.large.url}"
alt="{if !empty($category.image.legend)}{$category.image.legend}{else}{$category.name}{/if}"
<img src="{$category.cover.large.url}"
alt="{if !empty($category.cover.legend)}{$category.cover.legend}{else}{$category.name}{/if}"
fetchpriority="high"
class="img-fluid"
width="{$category.image.large.width}"
height="{$category.image.large.height}">
width="{$category.cover.large.width}"
height="{$category.cover.large.height}">
</div>
{/if}
</div>
Expand Down
17 changes: 13 additions & 4 deletions templates/catalog/_partials/subcategories.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,21 @@
<div class="subcategory__wrapper col-6 col-lg-4 col-xl-3">
<a class="subcategory" href="{$subcategory.url}" title="{$subcategory.name|escape:'html':'UTF-8'}">
<div class="subcategory__image">
{if !empty($subcategory.image.small.url)}
{if !empty($subcategory.thumbnail.small.url)}
<img
class="img-fluid"
src="{$subcategory.image.small.url}"
width="{$subcategory.image.small.width}"
height="{$subcategory.image.small.height}"
src="{$subcategory.thumbnail.small.url}"
width="{$subcategory.thumbnail.small.width}"
height="{$subcategory.thumbnail.small.height}"
alt="{$subcategory.name|escape:'html':'UTF-8'}"
loading="lazy"
>
{else}
<img
class="img-fluid"
src="{$urls.no_picture_image.small.url}"
width="{$urls.no_picture_image.small.width}"
height="{$urls.no_picture_image.small.height}"
alt="{$subcategory.name|escape:'html':'UTF-8'}"
loading="lazy"
>
Expand Down

0 comments on commit 813304d

Please sign in to comment.