Jump to content

Vérifier existence d'un fichier dans un .tpl


Recommended Posts

Bonjour,

 

J'aimerais afficher une image quand elle existe dans la page des fabriquants mais je n'y arrive pas !

 

Ci-dessous mon code :

{include file=$tpl_dir./breadcrumb.tpl}
<h2>{l s='List of products by manufacturer:'} {$manufacturer->name|escape:'htmlall':'UTF-8'}</h2>
{assign var="filename" val="/themes/prestashop/img/marques/{$manufacturer->name|replace:' ':'_'}.jpg"}
{if $filename|file_exists}
<br />
<img src="/themes/prestashop/img/marques/{$manufacturer->name|replace:' ':'_'}.jpg" alt="{$manufacturer->name}" />
{/if}

{include file=$tpl_dir./errors.tpl}
{if $products}
{include file=$tpl_dir./product-sort.tpl}
{include file=$tpl_dir./product-list.tpl products=$products}
{include file=$tpl_dir./pagination.tpl}
{else}
<p class="warning">{l s='No products for this manufacturer.'}</p>
{/if}

 

Merci beaucoup par avance pour votre aide

Cordialement

Fabrice

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...