I made a custom marker for tt_news which shows the first image from the media field, OR the third if it belongs to certain category (lets say category with ID = 2). I dont know how to make that conditional. This is what I have so far:
10 = IMAGE
10.file{
width = 550
height = 350
import = uploads/pics/
import{
field = image
listNum = 0
#If also belongs to the category "Startseite", the listNum should be 2
listNum.stdWrap.override = TEXT
listNum.stdWrap.override{
value = 0
if{
#??????
}
}
}
}
You need to write custom condition as described in doc in
userFuncsection (bottom)http://typo3.org/documentation/document-library/core-documentation/doc_core_tsref/4.3.2/view/1/4/
News and categories are connected with MM relation so you just to check if MM table contains this pair…
typo3conf/localconf.php:somwhere in TS after your
10 = IMAGE { ... }block:edit:
As you can see in the sample it works only if news is displayed (ie. if param &tx_ttnews[tt_news] exists in URL)
To check similar check per each list item you need to use custom marker via hook (as described in tt_news manual) by using extraItemMarkerProcessor – then you can use similar condition per each $row to display different images.