Quote from: ZAP at Jul 08, 2007, 03:15 PM
I think that what Jason is getting at is that the TV output won’t be parsed by this function (it will just return the value in the database regardless of output widgets and whatnot, so the function name is rather misleading). That may not matter to you in this circumstance, but if it does you’ll need to use a different method. One thing that you could try if you need a parsed TV value is passing it as a snippet parameter (e.g., [[mysnippet? &tvValue=`[*lang*]`]] ).
That’s actually not true ZAP; the getTemplateVarOutput() call should return the processed output for the document id you specify in the call, exactly as if you had called it using the tags on that document. The function name is completely accurate. What you describe is getTemplateVars(). In fact, I just fixed a bug related to this in the 0.9.6 release, that was not properly getting the value for @INHERIT bindings from other documents. If you are encountering other problems getting the proper output from this function, please let us know.
The approach of passing the TV in the snippet parameter
may not work in some cases (I believe that was originally what was being attempted) , depending on the cacheability of the page, if it’s called with non-cacheable tags, i.e. [!snippet? ¶m=`[*lang*]`!], etc.; that’s all I was getting at. But after looking again at the issue, I just noticed the expectation of getting the snippet parameter from the $_GET array. In fact it would be extract()’d as an actual php variable, so the original code should have been:
if(isset($tvValue)) {$var=$tvValue;}
If you wanted to be able to override that TV’s value from the query string in a URL, you could look at the $_GET array...