<![CDATA[ getTemplateVarOutput - My Forums]]> https://forums.modx.com/thread/?thread=19735 <![CDATA[Re: getTemplateVarOutput]]> https://forums.modx.com/thread/19735/gettemplatevaroutput#dis-post-109843 Quote from: silent at Aug 17, 2006, 05:27 PM

So: the only thing I was missing were the ’’ around the * ? (I simply could not imagine that wildcards would work in function-calls like this..)

Yep, and it’s a hard-coded option, i.e. * = all TV’s, so not really a wildcard per se; otherwise you specify an array of specific TV names to return the values for.]]>
opengeek Aug 17, 2006, 12:35 PM https://forums.modx.com/thread/19735/gettemplatevaroutput#dis-post-109843
<![CDATA[Re: getTemplateVarOutput]]> https://forums.modx.com/thread/19735/gettemplatevaroutput#dis-post-109842
So: the only thing I was missing were the ’’ around the * ? (I simply could not imagine that wildcards would work in function-calls like this..)
Fine! And, because I’m not interested in capturing other docs (@DOCUMENT) or re-rendering widget stuff, that’s all I need. I just want access to normal content for the new version of my PageKeywords-snippet.
Thanks Jason!]]>
silent Aug 17, 2006, 12:27 PM https://forums.modx.com/thread/19735/gettemplatevaroutput#dis-post-109842
<![CDATA[Re: getTemplateVarOutput]]> https://forums.modx.com/thread/19735/gettemplatevaroutput#dis-post-109841
Until then, you’ll need to look at the document.parser.class.inc.php and duplicate the TV rendering logic.]]>
opengeek Aug 17, 2006, 12:16 PM https://forums.modx.com/thread/19735/gettemplatevaroutput#dis-post-109841
<![CDATA[Re: getTemplateVarOutput]]> https://forums.modx.com/thread/19735/gettemplatevaroutput#dis-post-109840 I thought that a cominbation of getTemplateVars to get an array of TVnames and then cycling it using getTemplateVarOutput could do this job. Seemed a bit too complicated.
Ok, then, at least I have an option now, thanks again!]]>
silent Aug 17, 2006, 11:23 AM https://forums.modx.com/thread/19735/gettemplatevaroutput#dis-post-109840
<![CDATA[Re: getTemplateVarOutput]]> https://forums.modx.com/thread/19735/gettemplatevaroutput#dis-post-109839 site_tmplvar_contentvalues table in the database, I’m pretty sure this is where the information you seek is stored.

You could create a custom query to grab only the TV content for the doc which would be something like the code below:
Note this example only counts the number of TVs for the document which has this snippet, but you can modify as needed:

$output ="";
$sql = "SELECT * FROM ".$modx->dbConfig['dbase'].".".$modx->dbConfig['table_prefix']."site_tmplvar_contentvalues WHERE contentid='".$modx->documentObject['id']."'";
     $rs = @$modx->dbQuery($sql);
     $limit = @$modx->recordCount($rs);
       if($limit > 0 ){
           $output .="There are ".$limit." TVs for this document";
       }else{
           $output .="No TVs found";
       }
 return $output;
]]>
breezer Aug 17, 2006, 11:14 AM https://forums.modx.com/thread/19735/gettemplatevaroutput#dis-post-109839
<![CDATA[getTemplateVarOutput]]> https://forums.modx.com/thread/19735/gettemplatevaroutput#dis-post-109838
How can I get an array of all TV-content present on a page?
something like
"$contentarray = $modx->getTemplateVarOutput(*,$docID);"
As far as I can see I always have to know the name of the TV to ask for its content.
But if I do not know the names and just want the rendered output of all TVs for a page?

any clues?

Thanks!]]>
silent Aug 17, 2006, 09:54 AM https://forums.modx.com/thread/19735/gettemplatevaroutput#dis-post-109838