I am trying to use a Snippet in Ditto that calls an image from a TV and creates a thumb.
If doc does not have image, a default one is supplied.
What I have at the moment is:
<?php
$TVname = isset($tv)?$tv:'Main-Image'; // Include TV name
if( $TVarray = $modx->getTemplateVarOutput(array($TVname)) ){
$tvOutput = $TVarray[$TVname];
if(empty($tvOutput)) return '<img src="assets/images/logotipo.jpg" alt="[+title+]">'; // if TV is empty, else do...
return '<img src="[[phpthumb? &input=`[*Main-Image*]` &options=`w=100`]]" alt="[*title*]">'; // Display Code with TV included
}
return '';
?>
But when the page is rendered, it displays the current pages image and not the ones created by Ditto.
How can I tell it to grab the TV from the correct pages IDs?
PS. Using Evo v1.0.15