[TYPO3-ttnews] Add and substitute marker with typoscript

Martin Ficzel martin.ficzel at gmx.de
Thu May 10 18:15:57 CEST 2007


Martin Schmidt schrieb:
> Could this be used to achieve sth. like the output of the category title 
> before each related news title ?
> Instead of :
> Related News 1
> Related News 2
> 
> Like:
> Category1: Related News 1
> Category1: Related News 2
> 
> I�m trying to to that by modifying the class.tx_ttnews.php, putting
> 
> $relrow['title'] = $cUid['title'].": ".$relrow['title'];
> 
> into the "getRelated()" function.
> Which works, but only in default language.
> And I dont think its THE way to do it...
> 
> Martin

ofcourse you shoud do it that way! the hook code looks like this.

// class.tx_ttnews.php

> // Adds hook for processing of extra item markers
> if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tt_news']['extraItemMarkerHook'])) {
> 	foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tt_news']['extraItemMarkerHook'] as $_classRef) {
> 		$_procObj = & t3lib_div::getUserObj($_classRef);
> 		$markerArray = $_procObj->extraItemMarkerProcessor($markerArray, $row, $lConf, $this);
> 	}
> }

wich means that you can override the existing settings and that you have
aceess to the tsconfig and the whole record row in your hook method
that's more than enough. the advantage for you is that by providing a
hook you are creating an update proof solution.


regards Martin


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