Hi,
I know this is a noob question but I haven't managed to find a solution.
I'm using MODX 2.2.9-pl
I have a TV generated by "Simple File Upload TV"
http://modx.com/extras/package/simplefileuploadtv
The output of the TV is set to 'default'.
On some pages the client may choose to pick a photo, on other pages they may choose not to, so I wanted to write a snippet that renders the <img> tag only when there is a photo selected.
Because it failed to work like expected, I tried a simple test snippet:
$myphoto= '[[*Photo1]]';
if (!empty($myphoto)){
echo('This is the file: '.$myphoto);
}else if(empty($myphoto)){
echo('Empty');
};
When I have a photo selected, I see the correct output: "This is the file: images/properties/_prop25-10.Island-Villas-2.jpg "
However, when I have no photo selected, instead of rendering the string "Empty", I get "This is the file: "
I don't know how to go about it. I would appreciate any help
I have also tried:
and again it does not seem to match with the situation where no photo is selected.