Hi there,
i got a Snippets on my site which i want to execute depending if a TV is filled or not.
right now i got this solution:
<?php
$photos = $modx->getTemplateVar('photos');
if (!empty($photos['value'])) {
$SnippetCall = '{{SnippetCall}}';
return $SnippetCall;
}
return;
?>
"photos" is the TV which i want to be checked, and the Chunk "SnippetCall" contains, well, yes, the actual Snippet call. The Value of the TV is used for the Snippet output.
This works, but is it the right approach? (e.g. preformance-wise) btw. Evo 1.0.5
thanks, j