Hi there,
i try to return the value of a snippet which is placed inside a ditto template chunk. but no matter how i set and change the caching i get no output. if i call the snippet on the ressource page itself it works.
[!Ditto? &parents=`59` &depth=`1` &display=`all` &sortBy=`menuindex` &sortDir=`ASC` &tpl=`calendarTpl` &hiddenFields=`enddatetv` !]
on a non cached ressource, with the template "calendarTpl"
<div class="cal">
<h3 class="calheader">[+pagetitle+] / [+startdate+] [[enddate]]</h3>
<div class="calcontent">[+content+]</div>
</div> and the snippet "enddate":
<?php
$output="";
$id=$modx->documentIdentifier;
$document_tvs = $modx->getTemplateVarOutput(true, $id);
$enddate=$document_tvs['enddatetv'];
if (!empty($enddate['value'])) {
$output = $enddate;
return $output;
}
?>
calling the template via @File property in order to avoid caching problems
http://modxrules.com/articles/take-advantage-of-dittos-file-property didn’t work as well. a simple snippet call e.g.
does work, so it’s probably snippet code related. i’m doing this because i try to avoid PHX btw.
any ideas what i’m doing wrong?
thanks, j