[TYPO3-ttnews] Once again: Extension of ext:news

Anna Doring anna.doring at web.de
Fri Aug 10 12:38:43 CEST 2012


Hi,

I tried to extend the tx_news extension with this tutorial:
http://forge.typo3.org/projects/extension-news/wiki/Extend_Classes

I want to have an additional field "testfield" which is shown in the 
detail view of the articles.

My actions:

1. I used the extensionsbuilder to create a new extension with the name 
"extendnews" and extended  the tx_news_domain_model_news with these 
settings:
http://s14.directupload.net/images/120810/ybb2zzuc.jpg
Now the table has a new field called "testfield".
-----------------------
2. I edited EXT:extendnews/Classes/Domain/Model/News.php. Now it looks like:

class Tx_Extendnews_Domain_Model_News extends Tx_News_Domain_Model_News {

     /**
      * testfield
      *
      * @var string
      */
     protected $testfield;

     /**
      * Returns the testfield
      *
      * @return string $testfield
      */
     public function getTestfield() {
         return $this->testfield;
     }

     /**
      * Sets the testfield
      *
      * @param string $testfield
      * @return void
      */
     public function setTestfield($testfield) {
         $this->testfield = $testfield;
     }

}
-------------------------------
3. I created the extend-news.txt with the content "Domain/Model/News" 
file in EXT:extendnews/Resources/Private/
-----------------------
4. I wrote {newsItem.testfield} into 
EXT:news/Resources/Private/Templates/News
-----------------------
5. I changed the news type to "extendnews News" and wrote something in 
the new tab "News". I cleared the TYPO3 cache.
-----------------------

But: Nothing happens. I cant print the content of my testfield.

Where is the fault?

Regards
Anna


More information about the TYPO3-project-tt-news mailing list