新闻 3.0.1 - 自定义模板 [英] News 3.0.1 - custom templates

查看:27
本文介绍了新闻 3.0.1 - 自定义模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从我升级到 Typo3 6.+ 以来,我一直很难让我的自定义模板/部分在从 News 3.0.1 扩展的自定义扩展下工作..>

当然我浏览了文档:http://docs.typo3.org/typo3cms/extensions/news/stable/singlehtml/#changed-paths-of-the-template

Since I upgraded to Typo3 6.+, I've had a lot of hard times to get my custom templates/partials to work under a custom extension extended from News 3.0.1.

但我不明白,我尝试将文档中的打字稿用于我的设置和常量,但我无法让它工作 --> ext:news 的默认模板/部分是那些一直出现.

Of course I ran through the documentation : http://docs.typo3.org/typo3cms/extensions/news/stable/singlehtml/#changing-paths-of-the-template

这是我的配置(设置):

But I don't get it, I tried to use the typoscript from the documentation into my setup and constants, but I can't get it to work --> the default templates/partials from ext:news are the ones that show up all the time.

Here is my Configuration (setup) :
30 = 用户30{userFunc = tx_extbase_core_bootstrap->运行扩展名 = 新闻插件名称 = Pi1switchableControllerActions {消息 {1 = 列表}}看法 {templateRootPath = fileadmin/templates/ext/myExt/Templates/partialRootPath = fileadmin/templates/ext/myExt/Partials/layoutRootPath = fileadmin/templates/ext/myExt/Layouts/}设置

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 以前的版本有用,现在我不明白.

This code worked for me in the past with previous versions of News and Typo3, now I just don't get it.

任何形式的帮助将不胜感激.谢谢.

Any help of some sort would be very much appreciated. Thank you.

推荐答案

从 3.0.0 版本开始,EXT:news 使用了 layoutRootPathstemplateRootPathspartialRootPaths 而不是它们的单一变体.这使您能够仅复制和修改您真正需要更改的模板,而不是复制所有模板.看看 default设置.

As of version 3.0.0, EXT:news is using the layoutRootPaths, templateRootPaths and partialRootPaths instead of their singular variant. This enables you to only copy and modify the templates you really need to change instead of copying all. Have a look at the default settings.

所以你的配置应该尊重新的默认配置:

So your configuration should respect the new default configuration:

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 的任何值,您的模板将具有优先权.

EXT:news uses the key 100, so if you use anything greater than 100, your templates will have priority.

这篇关于新闻 3.0.1 - 自定义模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆