如何在prestashop中实现带有.tpl文件链接的映像



我需要添加"替换"现有图像,并将其链接到prestashop类别.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}

此图片带有链接:

<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语句,并在其中拥有自己的代码。不过,原始图像被用作背景图像。因此,如果你想在所有类别上显示相同的图像,那么你可以在那里对其进行"硬编码":

最新更新