Hi there, I'm trying to edit my signup.html form so that if people come to it from price group -1 they are shown one header graphic, and if they come to it from any other they are not shown a header graphic. This is the code I've got and I can't seem to get it to work properly {if ($vars['price_group'] == -1) <img src="graphic_file.jpg" width="216" height="139" alt="alt tag" /> else } Can anyone advise please on how to get this working? Thanks for your help Jason
Are you getting an error of some kind (on screen or in error log) or is it just not working for you? At quick glance and issue may be that, as you are working with Smarty, you have to structure it a bit different. example from the smarty reference guide Code: {if $name eq 'Fred'} Welcome Sir. {elseif $name eq 'Wilma'} Welcome Ma'am. {else} Welcome, whatever you are. {/if} so that would translate to something like: Code: {if ($vars['price_group'] eq -1)} <img src="graphic_file.jpg" width="216" height="139" alt="alt tag" /> {else} {/if} I haven't tested that so you may need to do some tinkering with it.
Skippy's code looks fine, I think the missing curly brackets were the problem. But I always had issues with the smarty code, so I started avoiding it entirely. Now, I just put all my php inside the {php} {/php} smarty tags, and that does it. So another option would be to just write typical php code inside the smarty php tags and echo your img the normal way, ignoring the weird smarty tags entirely.
Hello, How about the following: PHP: {if $smarty.request.price_group == -1} <img src="graphic_file.jpg" width="216" height="139" alt="alt tag" /> {else} {/if} Jimmy
Hello, My only reason for responding is that I didn't think $vars['price_group'] would work from the smarty template. I thought you would have to use $smarty.request.price_group instead. But I'm no expert on Smarty. Jimmy
Jimmy, you are probably right.. I haven't touched that side of things for some time (hence the disclaimer :-p)