title: php script is parsing content from RTE (tt_news) but internal links are not appearing as speaking url
body: <p>I have a news article with internal links. In the RTE I see links like</p>
  
  <p><a href="http://www.yourdomain.com/?id=3" rel="nofollow">http://www.yourdomain.com/?id=3</a></p>
  
  <p>in the html text mode. The problem is that this link also appears on the frontend. RealURL should convert this link to something like</p>
  
  <p><a href="http://www.yourdomain.com/products/" rel="nofollow">http://www.yourdomain.com/products/</a></p>
  
  <p>The content of RTE is currently parsed like this</p>
  
  <pre><code>$parseObj = t3lib_div::makeInstance('t3lib_parsehtml_proc'); 
  $txt = $parseObj-&gt;TS_links_rte($result['bodytext']);
  $txt = $parseObj-&gt;TS_transform_rte($txt);
  </code></pre>
  
  <p>I read that I should use something like this</p>
  
  <pre><code>$pObj = t3lib_div::makeInstance('tslib_pibase');
  $txt = $pObj-&gt;pi_RTEcssText($result['bodytext']);
  </code></pre>
  
  <p>but I don't know how can I access this function. I get</p>
  
  <p><code>Fatal error: Call to a member function parseFunc() on a non-object in /home/myuser/www/home/typo3/sysext/cms/tslib/class.tslib_pibase.php on line 1384</code></p>
  
  <p>What is the right way doing this? How can I access the function <code>pi_RTEcssText</code>? Do I have to use a class? Are there other ways doing it without a class?</p>
  
  <h1>EDIT:</h1>
  
  <p>I created a new template with TemplaVoila and defined <code>lib.newscontent</code> as TS object path.</p>
  
  <h2>TS Main Template</h2>
  
  <pre><code>includeLibs.user_news = fileadmin/templates/php_scripts/news/class.news.php
  
  lib.newscontent = USER_INT
  lib.newscontent {
    userFunc = user_news-&gt;main
    userFunc.bodytext.parseFunc &lt; lib.parseFunc_RTE
  }  
  </code></pre>
  
  <h2>class.news.php</h2>
  
  <pre><code>&lt;?
  
  class user_news {
  
      var $cObj;
  
      private $conf;
  
      function main($content,$conf) {
          $this-&gt;conf = $conf; 
          $this-&gt;setPreferences();        
          $content .= $this-&gt;aktuelleNews();
  
          return $content;
      }
  
      private function aktuelleNews() {
          $res = $GLOBALS['TYPO3_DB']-&gt;exec_SELECTquery(
                  '*',         // SELECT ...
                  'tt_news',     // FROM ...
                  'pid=22 AND deleted=0 AND hidden=0',    // WHERE...
                  '',            // GROUP BY...
                  'datetime DESC'    // ORDER BY...
          );
  
          $i = 1;
          $out_list = '&lt;ul id="news"&gt;';
          while ($data = $GLOBALS['TYPO3_DB']-&gt;sql_fetch_assoc($res)) {
              $date = date("d.m.Y",$data['datetime']);
              $out_list .= '&lt;li&gt;&lt;a href="#section'.$i.'"&gt;'.$date.': '.$data['title'].'&lt;/a&gt;&lt;/li&gt;';
              $out_detail.= $this-&gt;outputnewsdetail($data,$i);
  
              $i++;
          }
          $out_list .= '&lt;/ul&gt;';
          return $out_list . $out_detail;
      }
  
      private function outputnewsdetail($result,$count){
          $this-&gt;cObj-&gt;start($result, 'tt_news');
  
          $bodytext = $this-&gt;cObj-&gt;stdWrap($result['bodytext'], $this-&gt;conf['bodytext']);
          $bodytext = $this-&gt;cObj-&gt;parseFunc($bodytext,$GLOBALS['TSFE']-&gt;tmpl-&gt;setup['lib.']['parseFunc_RTE.']);
  
          return $bodytext;
  
      }
  
      private function setPreferences() {
  
      }
  
  }
  ?&gt;
  </code></pre>
  
  <h2>localconf.php</h2>
  
  <pre><code>include(PATH_site.'fileadmin/templates/php_scripts/news/class.news.php');
  </code></pre>
  
  <h2>Remaining question</h2>
  
  <p>Why does the rendering part in the TS Main Template doesn't work? I used</p>
  
  <pre><code>$this-&gt;cObj-&gt;parseFunc($bodytext,$GLOBALS['TSFE']-&gt;tmpl-&gt;setup['lib.']['parseFunc_RTE.']);
  </code></pre>
  
  <p>to get my result.</p>