1

我正在使用带有插件 tt_news 的 Typo3 版本 6.2。

我想做的就是:

  • 在我的网站上有一个简单的页面
  • 在那个页面上,我想要一个 tt_news 单一视图
  • 这个视图的 news_id 应该是静态的(由我设置)而不是 GET 变量

用例:

我们的公司有很多部门。对于每个部门,我们的网站上都有几个子页面。现在我想为每个部门的网站添加特定的新闻。喜欢:在团队管理页面上,我想显示 ID = XY 的新闻。

有什么办法可以让这个工作吗?

4

1 回答 1

2

如果没有请求其他记录的 SINGLE 视图,则将以下行插入到要在 SINGLE 视图中显示所选新闻项目的页面上的 ext-template 的设置字段中:

# 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
}

更多信息在这里 http://docs.typo3.org/typo3cms/extensions/tt_news/3.5.1/ExtNews/Configuration/TyposcriptExamples/Index.html#default-news-id

于 2015-06-02T15:52:29.093 回答