Hi all.
Sorry for the super long delay in this post, but that post above doesn’t quite work (at least, not from what we could figure). Luke used that as a starting point and made this, which seems to work absolutely beautifully:
There’s a feature/bug tracking request here:
http://modxcms.com/bugs/task/129
// HACK **********************************************************
// Insert this about line 1700 in document.parser.class.inc.php
// right after function getTemplateVarOutput
# Set template variable value
function setTV($tvname, $value, $docid="") {
if($tvname== "") return false;
if($docid == "") $docid = $this->documentIdentifier;
//get id of tv
$result=$this->db->select("id", $this->getFullTableName("site_tmplvars"), "name = '". $tvname . "'");
if (!$result) return false;
$row=$this->fetchRow($result);
// query the db to see if there are any records to update
$result=$this->db->select("Count(*) AS RecordsExist", $this->getFullTableName("site_tmplvar_contentvalues") , "tmplvarid=".$row['id']." AND contentid=".$docid);
$row2=$this->fetchRow($result);
if (!$row2['RecordsExist']) {
$fields = array(
"tmplvarid" => $row['id'],
"contentid" => $docid,
"value" => $value
);
$rows_affected = $this->db->insert($fields, $this->getFullTableName("site_tmplvar_contentvalues"));
} else {
$rows_affected = $this->db->update("value='" . $value . "'", $this->getFullTableName("site_tmplvar_contentvalues") , "tmplvarid=".$row['id']." AND contentid=".$docid);
}
return $rows_affected;
}
// END HACK **********************************************************
We made a modified NewsPublisher snippet as well that uses this. If anybody wants to see that, just let me know. It has some stuff hardcoded, so it’s not really great for a general release, but if anybody wants to take it and run with it it shouldn’t be too hard.
Best,
Brett
PS: jlarson, if your’s works, sorry! We (Luke and I) didn’t have any luck with it, but maybe it’s just because we goofed something.

If they both work, I guess that’s great too!