TYPO3新闻-定义自己的templateLayouts

问题描述

我正在使用TYPO3 v10.4。与新闻扩展名。我想添加自己的模板,可以在不同页面上对其进行自定义。

我遵循了官方新闻指南:https://docs.typo3.org/p/georgringer/news/master/en-us/AdministratorManual/Templates/TemplateSelector/Index.html

在我的Setup.ts中,我定义了:

plugin.tx_news {
  view {
    templateRootPaths >
    templateRootPaths {
      0 = EXT:news/Resources/Private/Templates/
      1 = Resources/Private/Ext/news/Templates/
    }

    partialRootPaths >
    partialRootPaths {
      0 = EXT:news/Resources/Private/Partials/
      1 = Resources/Private/Ext/news/Partials/
    }

    layoutRootPaths >
    layoutRootPaths {
      0 = EXT:news/Resources/Private/Layouts/
      1 = Resources/Private/Ext/news/Layouts/
    }

    #widget.GeorgRinger\News\ViewHelpers\Widget\PaginateViewHelper.templateRootPath = Resources/Private/Ext/news/Templates/
  }

  settings {
    list {
      cropMaxCharactersSmall = 100
      cropMaxCharactersHigh = 500
    }
  }

  templateLayouts {
    1 = Homepage
    2 = Default Layout
  }
}

不幸的是,我定义的布局没有出现在新闻插件的BE中。 该设置通常可以正常运行,因为我使用的是自定义的模板和部分以及设置部分中的变量。

有人知道可能会丢失什么吗?

解决方法

tx_news.templateLayouts属于您的TSConfig,而不属于TypoScript设置。

顺便说一句,您的TypoScript代码段看起来有些怪异。我尝试过重新格式化,但也许您想再次进行仔细检查。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...