We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9572
    • 56 Posts
    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?
      • 7923
      • 4,213 Posts
      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."
        • 2762
        • 1,198 Posts
        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 **********************************************************

          Free MODx Graphic resources and Templates www.tattoocms.it
          -----------------------------------------------------

          MODx IT  www.modx.it
          -----------------------------------------------------

          bubuna.com - Web & Multimedia Design
          • 2762
          • 1,198 Posts
          and this is the updated newspublisher for it
            Free MODx Graphic resources and Templates www.tattoocms.it
            -----------------------------------------------------

            MODx IT  www.modx.it
            -----------------------------------------------------

            bubuna.com - Web & Multimedia Design
            • 2762
            • 1,198 Posts
            works for me in a lot of websites
              Free MODx Graphic resources and Templates www.tattoocms.it
              -----------------------------------------------------

              MODx IT  www.modx.it
              -----------------------------------------------------

              bubuna.com - Web & Multimedia Design