[TYPO3-ttnews] extend news 2

Georg Ringer typo3 at ringerge.org
Fri Apr 6 07:02:17 CEST 2012


Hi,

I am explaining a bit the feature Stefano describes.

Requirements: The version from git, *not* the one from TER

Use kickstarter or whatever to extend the tables, in this case:
tx_news_domain_model_news. If your work for the backend is finished you
can start extending the model.

1) create the file Resources/Private/extend-news.txt and add
-------
Domain/Model/News
-------
there (without the '---'). Start a new line for every class you want to
extend

2) Your own code needs to be in the same structure, so you need to have
Classes/Domain/Model/News.php which could look like
----------------------------
<?php
class Tx_Newsfe_Domain_Model_News extends Tx_News_Domain_Model_News {

	/**
	 * @var integer
	 *
	 */
	protected $txNewsfeFeuser;

	/**
	 * @return integer
	 */
	public function getTxNewsfeFeuser() {
		return $this->txNewsfeFeuser;
	}

	/**
	 * @return integer
	 */
	public function getRelatedFeuser() {
		return $this->txNewsfeFeuser;
	}


	public function setTxNewsfeFeuser($txNewsfeFeuser) {
		$this->txNewsfeFeuser = $txNewsfeFeuser;
	}
}
?>
---------------------------

3) Clear cache
4) Finished

you can then call e.g. {newsItem.relatedFeuser} in your template

Please report your feedback!

Georg


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