[TYPO3-ttnews] Make ext:news detail view show most recent item when no id given
Loek Hilgersom
loek at netcoop.nl
Tue Aug 28 23:21:15 CEST 2012
Hi,
I'm trying to make the extbase news extension show the most recent article in
the detail view, as a default value when no id is given, but I can't find a nice
way to do this.
The ugly way to achieve this would be similar to how you would solve this with
tt_news:
[PIDinRootline = 11] && [globalVar = GP:tx_news_pi1|news=]
lib.content.main >
lib.content.main = CONTENT
table = tx_news_domain_model_news
select {
pidInList = 4
orderBy = tx_news_domain_model_news.datetime DESC
max = 1
}
renderObj = COA
renderObj {
....
}
}
[end]
But tt_news provided a default rendering definition, and news doesn't (as far as
I know), and I wouldn't like to duplicate the entire singleview template in a TS
renderObj...
Another way to handle this would be by setting
plugin.tx_news.settings {
singleNews = CONTENT
singleNews {
table = tx_news_domain_model_news
select {
pidInList = 4
orderBy = tx_news_domain_model_news.datetime DESC
max = 1
}
renderObj = TEXT
renderObj.field = uid
}
}
but the settings in tx_news unfortunately dont support stdWrap, so this won't
work without hacking tx_news.
So what's the good way to handle this?
Thanks,
Loek
More information about the TYPO3-project-tt-news
mailing list