[TYPO3-ttnews] hook processSingleViewLink

Gregory Loichot gloichot at cross-systems.ch
Mon Mar 16 18:05:24 CET 2009


Hello,

I have news that belong to different categories and a news must be 
displayed (in SINGLE VIEW) in a defined page, in function of this 
category. For example (LIST NEW) :

News 1 belongs to Category 1 -> SINGLE VIEW on page 1
News 2 belongs to Category 2 -> SINGLE VIEW on page 2
News 3 belongs to Category 3 -> SINGLE VIEW on page 3

So I use the processSingleViewLink hook in tt_news to generate the good 
link. I works great. That's my function:

function processSingleViewLink(&$linkWrap, &$url, &$params, &$reference){		
$params['singlePid'] = $this->getSinglePidFromSysAndCat($params, 
$reference);					
$linkWrap = explode($reference->token, 
$reference->pi_linkTP_keepPIvars($reference->token, 
$params['piVarsArray'], $reference->allowCaching, 
$reference->conf['dontUseBackPid'], $params['singlePid']));			

$url = $reference->pi_linkTP_keepPIvars_url($params['piVarsArray'], 
$reference->allowCaching, $reference->conf['dontUseBackPid'], 
$params['singlePid']);
}

where getSinglePidFromSysAndCat() get the good singlePid of the news.
Some news may have "related news"... and it doesn't work any more !

In the function getRelated(), all links are good at line
$link = $this->getSingleViewLink($sPid, $row, $piVarsArray, true);
but are wrong at
$lines[] = $veryLocal_cObj->cObjGetSingle...

It seems that the sPid does not change...

Somebody has a solution ? Is it a bug ?

Thank you.


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