I figured out how to use Newspublisher to create web forms so I can write blog entries without entering the manager, but I can’t figure out how to select the parameters for TVs that I use.
How would I set the value of a TV using Newspublisher?
It doesn’t support TV’s.. The easiest way to do frontend editing to support tv’s too would be using eform and docmanager i’d guess..
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
there is a mod version that works with TV.
here you can find the topic:
http://modxcms.com/forums/index.php/topic,824.15.html
you need to add this code to your document.parser.class.inc.php:
// 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 **********************************************************
and this is the updated newspublisher for it
works for me in a lot of websites