![]() |
If image exists...
How do we do an if then statement in smarty such as...
Code:
if image exists then display image I know this has to be pretty simple. Can anyone help? Funky? Thanks, John7 |
Okay - there is not a standard smarty or xcart way of doing this but.... :)
first: create a new modifier file: modifier.file_exist.php and save it into your smarty plugins folder. Code:
<?php Then in the template where you wish for the file check to be used: {assign var="file" value="the_image_check_for.gif"} {if $file|file_exists} [img]{$file}[/img] {else} Show another image {/if} That'll do it :) |
Awsome!!!
Awsome!!!
I'm going to go test it out now. I'll keep you posted on how this turns out! Thanks Funky!!! JoHn7 |
It works!!!
It works!!! Perfectly!!!
Thanks so much!!! John7 |
All times are GMT -8. The time now is 09:46 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.