[TYPO3-english] Randomly Display tt_news Item with TypoScript
Scotty C
superscotty19 at yahoo.com
Thu Jun 11 09:54:27 CEST 2015
Hi everyone,
I have a categorized tt_news list of text+pic CEs. My goal is to use TS to display one item at random in a subpart. For example:
<title>
<image>
<text>
I know that if I use this code, I'll get an image at random, but it won't come from any category. I need it to only select images from a specific category:
subparts.NEWS_ITEM = COA_INT
subparts.NEW_ITEM {
10 = CONTENT
10 {
table = tt_news
select {
pidInList = 381
max = 1
orderBy = rand()
where = image != ''
} #end select
renderObj = COA
renderObj {
10 = IMAGE
10 {
wrap= <div>|</div>
file.import=uploads/pics/
file.import.field=image
file.import.listNum = 0
file.width=180
file.height=100c
stdWrap.typolink.parameter.field = ext_url
stdWrap.typolink.title.field = title
} # end 10
} # end renderobj
} # end 10
} # end subpart
... and I know that if I use this code, I'll get the title of the first item in the listing, but not random
20=RECORDS
20 {
# id des template-records
source = 381
source.insertData = 1
tables = tt_news
conf.tt_news >
conf.tt_news = TEXT
conf.tt_news.field=title
}
... but I need to put them together into one single block in the subpart! Help!
Thanks as always,
-Scott.
More information about the TYPO3-english
mailing list