natedogg3304 Reply #1, 3 years, 9 months ago
Hello-
I have TV that is setup for an image. What I want to do is write a conditional statement that checks to see if an image path is present and if it is it displays the image, but if not it doesn't display anything.
I am not a PHP developer, so I basically made up this code and put it in a snippet called CondImage, although I know it is wrong:
Then I would just call the snippet from within my template. Any help straightening me out would be appreciated.
Thanks
I have TV that is setup for an image. What I want to do is write a conditional statement that checks to see if an image path is present and if it is it displays the image, but if not it doesn't display anything.
I am not a PHP developer, so I basically made up this code and put it in a snippet called CondImage, although I know it is wrong:
<?php
$image = [*sidebarimage*]
if $image == "" {
} else {
<img src="[*sidebarimage*]" alt="" />
}
?>Then I would just call the snippet from within my template. Any help straightening me out would be appreciated.
Thanks
