我使用插件tt_news使用Typo3版本6.2。
我想做的就是:
用例:
我们有一个有很多部门的公司。对于每个部门,我们的网站上都有几个子页面。现在我想向每个部门网站添加特定的新闻。喜欢:在团队管理页面上,我想用ID = XY显示新闻。
有没有办法让这个工作?
答案 0 :(得分:2)
如果没有请求另一条记录的SINGLE视图,请将以下行插入要在SINGLE视图中显示所选新闻项目的页面的ext模板的设置字段:
# hide the "no news id" message
plugin.tt_news._LOCAL_LANG.default.noNewsIdMsg =
# set the tt_news singlePid to the current page
plugin.tt_news.singlePid = 977
# fill the content of the main-column to a tmp.object
tmp.pagecontent < page.10.subparts.contentarea
# clear the content of the main column
page.10.subparts.contentarea >
# build a new object for this column as content-object-array
page.10.subparts.contentarea = COA
page.10.subparts.contentarea {
10 = CONTENT
10.table = tt_news
10.select {
# insert the pids of all pages from where you want to fetch news.
# the recursive-field has no influence on this selection
pidInList = 25 # your pid
# orderBy = datetime desc
max = 1
# get element with news id 10 @zarathustra
where = tt_news.uid=10
}
# insert the object “10.” only if there is no SINGLE news selected
10.stdWrap.if.isFalse.data = GPvar:tx_ttnews|tt_news
# re-insert the normal pagecontent to the page
20 < tmp.pagecontent
}