[TYPO3-ttnews] Exclude Single from Lastes/List??

Stefan Kreisberg stefanNOSPAM at linkfactory.dk
Thu Jun 29 10:47:16 CEST 2006


Stefan Kreisberg wrote:

> Thomas Ziirsen wrote:
> 
>> Hello there,
>> 
>> I have a page with a single view and a latest view with the remaning
>> news. My problem is that when i select one of the remaning news to
>> display it in the single view its stille displayed in the remaning news
>> column. Is there anyone that has made something simalar?
>> 
>> Request for excludeSingleFromList function :P
>> 
>> Cheers
>> -Thomas
> 
> 
> Untested, but I'll try to answer with a selectConf hook, something like:
> 
> class tx_news_selectConf {
>         function processSelectConfHook($newsObj, $selectConf) {
>                 $arr=t3lib_div::_GP('tx_ttnews');
>                 if(intval($arr['tt_news'])) {
>                         $newsObj->selectConf['where'] .= ' AND tt_news.uid
>                         !=
> '.intval(t3lib_div::_GP('tt_news'));
>                 }
>         }
> }
> 
> BUBOC! (Beware untested block of code ...!)
> 
> -Stefan ;-)

Sorry, after looking into tt_news pi1 class it's obvious that the above is
wrong, here's a (untested) minor correction:


 class tx_news_selectConf {
         function processSelectConfHook($newsObj, $selectConf) {
                 $arr=t3lib_div::_GP('tx_ttnews');
                 if(intval($arr['tt_news'])) {
                         $selectConf['where'] .= ' AND tt_news.uid
                         !=
 '.intval(t3lib_div::_GP('tt_news'));
                 }
                return $selectConf;
         }
 }

Cheers :-)

-Stefan a.k.a. strato




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