新闻 3.0.1 - 自定义模板

News 3.0.1 - custom templates

自从我升级到 Typo3 6.+ 后,我经历了很多困难才能让我的自定义 templates/partials 在从 News 3.0.1 扩展的 自定义扩展下工作.

当然我运行通过文档:http://docs.typo3.org/typo3cms/extensions/news/stable/singlehtml/#changing-paths-of-the-template

但我不明白,我尝试将文档中的拼写错误用于我的设置和常量,但我无法让它工作 --> 默认 templates/partials 来自 ext:news是一直出现的。

这是我的配置(设置):

lib.cust_news= COA
   lib.cust_news{
     20 = TEXT
     20.wrap = <div>

     30 = USER
     30{
          userFunc = tx_extbase_core_bootstrap->run
          extensionName = News
          pluginName = Pi1

          switchableControllerActions {
            News {
                   1 = list
             }
          }

          view {
              templateRootPath = fileadmin/templates/ext/myExt/Templates/
              partialRootPath = fileadmin/templates/ext/myExt/Partials/
              layoutRootPath = fileadmin/templates/ext/myExt/Layouts/
           }

           settings < plugin.tx_news.settings
           settings {
              startingpoint = 9
              limit = 5
           }
      }

     40 = TEXT
     40.wrap = </div>
 }

这段代码过去对我适用于以前版本的 News 和 Typo3,现在我就是不明白。

我们将不胜感激任何形式的帮助。 谢谢。

从版本 3.0.0 开始,EXT:news 使用 layoutRootPathstemplateRootPathspartialRootPaths 而不是它们的单一变体。这使您可以只复制和修改您真正需要更改的模板,而不是复制所有模板。看看 default settings.

因此您的配置应遵循新的默认配置:

view {
  templateRootPaths.200 = fileadmin/templates/ext/myExt/Templates/
  partialRootPaths.200 = fileadmin/templates/ext/myExt/Partials/
  layoutRootPaths.200 = fileadmin/templates/ext/myExt/Layouts/
}

EXT:news 使用密钥 100,因此如果您使用任何大于 100 的值,您的模板将具有优先权。