[TYPO3-ttnews] Only display COA if news list is not empty (filtered by category)

Johannes Klug johannes.klug at silverage.de
Tue Mar 16 17:06:08 CET 2010


Hello,

I have the following problem I can't get my head around: I have a COA 
like this:

page...NEWS.10 = COA
page...NEWS.10 {
	10 = TEXT
	10 = <h1>News</h1>

	20 < plugin.tt_news
	20 {
		code >
		code = LATEST
	
		pid_list = 789
		singlePid = {$single_pid}
	
		categoryMode = 1
		categorySelection = 14
		latestLimit = 2

		...
	}
}

I want the COA only to be rendered if the list of news is not empty. 
However, the following obviously doesn't work:

page....NEWS.10.if {
	isTrue.numRows{
		table = tt_news
		select {
			pidInList = 789
			where = category=14
		}
	}
}

as the category relations are stored in an tt_news_cat_mm. So I tried a 
join (mostly wildy guessing):

page....NEWS.10.if {
	isTrue.numRows{
		table = tt_news
		select {
			pidInList = 789
			where = tt_news_cat.uid=14
			leftjoin = tt_news_cat, tt_news_cat_mm	ON ( 
tt_news_cat.uid=tt_news_cat_mm.uid_foreign AND 
tt_news.uid=tt_news_cat_mm.uid_local )
		}
	}
}

Unfortunately this doesn't work either. Any suggestions?

Thanks in advance,
Johannes


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