Quote from: muskokee at Jul 18, 2007, 08:00 PM
Because TV’s can accept the "@" bindings I was wondering if there was a way, as there is with a snippet, to keep the TV in a non-cache mode while the document is cached?
I have an @eval TV that I would like to use, but I also want to be able to cache my document.
For now, I believe the only way to do so would be to embed the output in a non-cacheable snippet, e.g. write a quick snippet called tvWrapper that does this...
<?php
return "[*{$tvName}*]";
?>
Then call your snippet...
[!tvWrapper? &tvName=`foobar`!]
Alternatively, you can just use the getTemplateVarOutput() function to get the value in a non-cacheable snippet. e.g. create snippet called tvOutput...
<?php
$tvOutputArray= $modx->getTemplateVarOutput(array ($tvName));
return $tvOutputArray[$tvName];
?>
Then call it like...
[!tvOutput? &tvName=`foobar`!]
In 0.9.7, you will be able to apply the non-cacheable token directly to all kinds of tags as described towards the middle of the
roadmap.