View Single Post
  #1  
Old 06-14-2007, 11:17 AM
  Warwick's Avatar 
Warwick Warwick is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Somewhere on the web through European connection
Posts: 868
 

Question If/Then statement to show table

I'm trying to come up with an if/then statement to show search keywords (in a table) when there are keywords entered, if not then it should not show.

In my case it's a table that needs to be shown with the following code:
Code:
<table> <tr> <td valign="top"><img src="{$ImagesDir}/icon.gif" width="15" height="17"></td> <td>{$lng.lbl_related_keywords} <br>{foreach from=$keywords item=keyword}<a href="_search.php?q={$keyword}">{$keyword}</a> {/foreach}<br></td> </tr> </table> [b]

This is what I tried (without success):
Code:
{if $keywords ne ""} <table> <tr> <td valign="top"><img src="{$ImagesDir}/icon.gif" width="15" height="17"></td> <td>{$lng.lbl_related_keywords} <br>{foreach from=$keywords item=keyword}<a href="_search.php?q={$keyword}">{$keyword}</a> {/foreach}<br></td> </tr> </table> {/if}

Can anybody help me with this?

Thanks in advance!
__________________
Installs: X-Cart 4.1.x - 4.4.x ∙∙ MySQL version: 5.0.45 ∙∙ Apache version: 2.2.8 (Unix) ∙∙ PHP version: 5.25
X-Cart add-ons: all ∙∙ Mods: A lot; too many ∙∙ Skin templates: Many
∙∙ Experience: Somewhere beyond newbie
-----------------------------------
------------------------------------------------------------------------------------------------------
Looking for the best dutch language pack? 4.1.x - 4.6.x compatibel, native speaker translation! More info
Reply With Quote