![]() |
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> This is what I tried (without success): Code:
Can anybody help me with this? Thanks in advance! |
Re: If/Then statement to show table
try
{if $keywords} You didn't say what is in the $keywords variable. Array? List? Text? An example of the contents would be nice. |
Re: If/Then statement to show table
Quote:
Unfortunately this doesn't work :( Quote:
|
Re: If/Then statement to show table
Hi Warwick!
Please, edit the <xcart_dir>/include/search.php script and replace: PHP Code:
with PHP Code:
After that you'll be able to use the {$keywords} Smarty variable in your templates. |
Re: If/Then statement to show table
Thanks Eugene!
I have implemented your modification and tried the following statements then but both don't work (yet); forgive me for being such newbie; I must be doing something very stupid. Code:
{if $keywords} and Code:
{if $keywords ne ""} |
Re: If/Then statement to show table
Please add the following code to a necessary template(at the very beginning):
Code:
{$keywords|print_r} then refresh the page(or search for any keywrods), do you see any debug info? |
Re: If/Then statement to show table
I have implemented the code you mentioned in the product template without any if/then statement and get: balancerailArray
(the 'balancerail' being the product name) |
Re: If/Then statement to show table
try using {if !empty($keywords)}{/if}
|
Re: If/Then statement to show table
Thanks inebriate but this doesn't work either :(
|
All times are GMT -8. The time now is 03:11 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.