Hello there!!!
I have a
TV [+hotelPrice+] input type: text, and a
SNIPPET [+priceDollars+].
The idea is, the client fill the TV and the snippet display a small HTML code that include the TV content, a price in this case, if the TV is empty, the HTML is not displayed!
Works Sweet!!!!!

(use it if you need it)
Snippet:
<?php
// parameters:
// &tvname - Set the TV name to be used, defaults to hotelPrice
$TVname = isset($TVname)?$TVname:'hotelPrice';
// fetch the output array of the TV
if( $TVarray = $modx->getTemplateVarOutput(array($TVname)) ){
#TV output is in index [$TVname][1]
$tvOutput = $TVarray[$TVname][1];
if(empty($tvOutput)) return ''; //bail out if no value
// Here is where we can start customizing the output.
// For now, just return the TV output in a <div> container
return '<div><p>Price from:</p>
<p>$[*hotelPrice*]</p>
</div>';
}
return '';
?>
THE PROBLEM!!!
I need to do the seem thing (display and hide) the HTML code with the TV information in it!
Called with a DITTO, but
IS NOT WORKING!!!
HELLLLPPPPPPPPP!!!!!!!!!!!!!!!!!!
here the codes:
Ditto Call:
[!Ditto? &parents=`53` &display=`all` &total=`all` &showInMenuOnly=`0` &orderBy=`menuindex ASC` &extenders=`summary` &randomize=`0` &tpl=`nl_sidebar_activities`&filter=`id,139,2` !]
Ditto Chunk:
<div id="packagesTextAct">
[[priceDollarsList]]
<a class="bookingSmall" href="[~218~]&formTitle=[+pagetitle+]" title="[+longtitle+]">See more</a>
</div>
I hope you understand!!!
Please some programer or someone with full ModX knowledge may be perfect!!!
i.m using:
ModX Evo 1.0.6
Ditto 2.1.0
Thank you Very Much!!!!