如何在 prestashop 中将带有 link 的图像实现为 .tpl 文件

How to implement image with link to .tpl file in prestashop

我需要将 "replace" 带有 url link 的现有图像添加到 prestashop category.tpl 文件

{if $category->id AND $category->active}
    <div class="content_scene_cat_bg"{if $category->id_image} style="background:url({$link->getCatImageLink($category->link_rewrite, 
$category->id_image, 'category_default')|escape:'html':'UTF-8'}) 
center center no-repeat; background-size:cover; height:229px;"{else} 
style="background: transparent url(**{$content_dir}themes/{$themename}/img/demo/category_image.jpg**) no-repeat scroll center center / cover; height: 229px"{/if}>
                                    {if $category->description}

这张图片 link:

<a href="/ako-nakupovat-na-splatky" title="Quatro - jednoduchý nákup na splátky" target="_blank"> <img src="http://www.quatro.sk/affiliate/quatro_850x350.jpg" width="850" height="350" alt="Quatro - jednoduchý nákup na splátky" /> </a> 

您可以删除该 if 语句并在其中只包含您自己的代码。不过,原始图像用作背景图像。因此,如果您希望同一图片显示在所有类别中,那么您可以 "hardcode" 将其放在那里: