真正编程 / 前端渲染
提供基本typoscript配置,用于模板化
4.0.0
2023-11-24 14:36 UTC
Requires
- typo3/cms-backend: ^11 || ^12
- typo3/cms-core: ^11 || ^12
- typo3/cms-fluid-styled-content: ^11 || ^12
README
Author: Michael Semle
E-Mail: git@mikeproduction.de
repo: https://github.com/true-programming/frontendrendering
此扩展提供基本typoscript配置,用于渲染具有流式的内容和页面。
特性
- 改进的lib.contentElement对象
- 库以渲染特定colPos的内容
- 库以渲染定义的页面和colPos的内容
使用方法
包含文件
要使用这些配置,只需从配置文件夹或导入setup.typoscript文件。
@import 'EXT:frontendrendering/Configuration/TypoScript/Lib/lib.contentElement.typoscript'
@import 'EXT:frontendrendering/Configuration/TypoScript/Lib/lib.fluidPage.typoscript'
@import 'EXT:frontendrendering/Configuration/TypoScript/Lib/lib.renderContent.typoscript'
@import 'EXT:frontendrendering/Configuration/TypoScript/Lib/lib.renderContentFromPid.typoscript'
或者
@import 'EXT:frontendrendering/Configuration/TypoScript/setup.typoscript'
对于PAGE对象的用法
库根据后端布局设置模板名称,而不带前缀pagets__
。要激活自定义配置,这可能看起来像这样
page = PAGE
page {
10 = CASE
10 {
key.data = pagelayout
default =< lib.fluidPage
pagets__newspage =< lib.fluidPage--news
}
}
对于内容元素的用法
lib.contentElement
已引用到核心中的tt_content.default
,所以我们只更改一些内容。模板名称设置为CType字段的值。
库lib.renderContent
提供一个cObject以渲染具有向上滑动选项的特定colPos的内容。
<f:cObject data="{colPos: 1}" typoscriptObjectPath="lib.renderContent"/>
<f:cObject data="{colPos: 1, slide: 1}" typoscriptObjectPath="lib.renderContent"/>
要从特定页面和colPos渲染内容,lib.renderContentFromPid
是完美的选择。
<f:cObject data="{pidInList: 1, colPos: 1}" typoscriptObjectPath="lib.renderContentFromPid"/>
<f:cObject data="{pidInList: '1,2,3', colPos: 1, slide: 1}" typoscriptObjectPath="lib.renderContentFromPid"/>
如何安装此扩展?
您可以通过composer(composer req trueprogramming/frontendrendering
)进行设置。
要求
- TYPO3 v11或v12。
许可协议
此扩展根据GPL v2+许可,与TYPO3核心相同。
有关详细信息,请参阅此存储库中的LICENSE文件。