[Solved] Check if variable is set in listit2
Posted: Tue Jun 11, 2013 6:39 pm
I'm using a template in Listit2 :
I want to check if $item->omschrijving has text. If so, an image should be displayed. If not, there should be no image.
Using the template above will always display the image as if $item-omschrijving is always filled with text.
I tryed :
I read the smarty manual but cannot find the solution.
How can I solve this.
Please help.
Musicscore
Code: Select all
<table>
{foreach from=$items item=item}
<tr>
<td width="210px"><div class="product">{$item->title|cms_escape}{if isset($item->omschrijving)}
<img class="info" src="images/Info-Icon.png" alt="{$item->omschrijving}" height="15" width="15">{/if}</div></td><td><div class="prijs">€ {$item->prijs}</div></td>
</tr>
{/foreach}
</table>Using the template above will always display the image as if $item-omschrijving is always filled with text.
I tryed :
Code: Select all
if isset($item->omschrijving)
if !empty($item->omschrijving)How can I solve this.
Please help.
Musicscore