[TYPO3-english] content RECORD
Philipp Gampe
phil at philippgampe.info
Fri Feb 19 19:05:10 CET 2010
Am 19.02.2010, 18:17 Uhr, schrieb Roberto Torresani <erreti at gmail.com>:
> Hi all!
> with the typoscript:
> subparts.NEWSTITLE = RECORDS
> subparts.NEWSTITLE.source = 1
> subparts.NEWSTITLE.tables = tt_news
>
> subparts.NEWSTITLE.conf.tt_news = HTML
> subparts.NEWSTITLE.conf.tt_news.value.field = title
>
> I have the title of the news with id = 1
>
> Is possible to have the title of the last news by id or for example by
> date?
last news by id does not make sense ... an id is unique
to get the latest news title, you could create a custom query ... this how
I did one for cal ... you can just adopt this one
page.10 >
page.10 = CONTENT
page.10 {
table = tx_cal_event
select {
where = start_date LIKE "2009%"
selectFields = `title`, `description` , `start_date` , `end_date`
pidInList = 48
}
wrap = <table>|</table>
renderObj = COA
renderObj {
10 = TEXT
10.field = title
.10.required = 1
10.wrap = <tr><td>|</td>
#20 = TEXT
#20.field = description
#20.wrap = <td>|</td>
30 = TEXT
30.field = start_date
#30.date = dd MM YYYY
30.wrap = <td>|</td></tr>
}
}
another far easier way would be to use somewhat like
temp.mymarker < plugin.tt_news
temp.mymarker {
code = LATEST
latestLimit = 1
templateFile = fileadmin/yourTemplate_File_with_just_a_Title_marker.tmpl
}
// not tested, look into manual for actual properties
Cheers
Phil
--
Philipp Gampe
http://www.philippgampe.info
More information about the TYPO3-english
mailing list