如何在prestashop中使用指向.tpl文件的链接实现映像

如何在prestashop中使用指向.tpl文件的链接实现映像,prestashop,categories,prestashop-1.6,Prestashop,Categories,Prestashop 1.6,我需要将“替换”现有图像添加到prestashop category.tpl文件的url链接 {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-

我需要将“替换”现有图像添加到prestashop category.tpl文件的url链接

{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}
{if$category->id和$category->active}
id_image}style=“background:url({$link->getCatImageLink($category->link\u rewrite,
$category->id_image,'category_default')|转义:'html':'UTF-8'})
中心不重复;背景尺寸:封面;高度:229px;“{else}
style=“background:transparent url(**{$content\u dir}themes/{$themename}/img/demo/category\u image.jpg**)无重复滚动中心/封面;高度:229px”{/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语句,只需在其中包含您自己的代码即可。但原始图像用作背景图像。因此,如果您希望在所有类别上显示相同的图像,那么您可以在其中“硬编码”它:

hyperlink仅适用于一个类(无div)好的,我解决了这个问题!