[TYPO3-ttnews] Replace tt_news-symbol in "related news" depending on category of the related item

Sönke Hartung hartung.germany at gmail.com
Mon Feb 6 02:09:16 CET 2012


Hello List,

I'm currently trying to replace the symbol of tt_news in the "related 
news" marker, depending on the categorie of the related item.

More precise:
I use tt_news for news (as usual) and for dates. Dates are sorted in 
it's own categorie (tt_news_cat uid 21). I refer with the "related 
news"-field between news and dates. Both, news and dates, appear in the 
"related news"-section. There they appear with the same icon, so it's 
not possible to distinguish the two "types".
Therfore I'm trying to change the icon of the related items, depending 
on their category.

I tried the TS below, but I'm not sure if the CASE-key data = 
register:newsCategoryUid is correct.

plugin.tt_news.getRelatedCObject.10.default.5 = CASE
plugin.tt_news.getRelatedCObject.10.default.5 {
   # Alte config löschen
   file >
   wrap >

   key.data = register:newsCategoryUid

   # Default für alle tt_news-Kategorien
   default = IMAGE
   default {
     file = EXT:tt_news/ext_icon.gif
     file.width = 18
     file.height = 16
     wrap = |  
   }

   # Ausnahme für tt_news_cat uid=21
   21 = IMAGE
   21 {
     file = othericon.png
     file.width = 32
     file.height = 32
     wrap = |  
   }
}

With this TS, related items shown under a news record with tt_news_cat 
21 get the othericon.png, no matter which category is defined for the 
related item. So the behaviour is kind of inverted. The CASE dosn't care 
about the tt_news_cat of the related target. It only checks the 
tt_news_cat of the currently shown tt_news record.
Therfore I guess, that my CASE-key is not the one, that I need.
Can anybody help me with this?

Many thanks and kind regards
Sönke


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