t3g / pagetemplates
从预定义模板创建页面
1.2.0
2020-04-25 10:47 UTC
Requires
- typo3/cms-backend: ^9.5 || ^10.4
- typo3/cms-core: ^9.5 || ^10.4
- typo3/cms-extbase: ^9.5 || ^10.4
- typo3fluid/fluid: ^2.3
Requires (Dev)
- bk2k/extension-helper: ^1.0@dev
- friendsofphp/php-cs-fixer: ^2.14
- overtrue/phplint: ^1.1
- roave/security-advisories: dev-master
- typo3/testing-framework: ^4.9 || ^5.0 || ^6.2
This package is auto-updated.
Last update: 2024-08-25 20:55:05 UTC
README
本扩展提供了提供和轻松使用页面创建模板的机会。
简单模式
默认情况下启用简单模式,可在扩展管理器中禁用。启用此开关后,页面模板模块将被禁用,并在点击菜单中启用一个新选项。此外,她还必须提供页面模板存储文件夹的UID。现在,编辑器可以在该存储文件夹内创建包含内容元素的页面。
- 在扩展管理器 > pagetemplates 中启用简单模式
- 在扩展管理器中添加模板文件夹的存储PID
YAML模式
为TYPO3页面提供基于yaml的模板。允许编辑器选择一个页面模板来创建新页面。允许在创建时编辑页面和内容属性。在扩展管理器中禁用简单模式后,将显示一个新模块。
页面TSConfig
YAML
文件夹结构
- Templates.yaml
- 结构
- example1.yaml
- example2.yaml
- 结构
主Templates.yaml文件包含可用模板的配置
example1: name: "Example Template 1" previewImage: "EXT:pagetemplates/ext_icon.svg" description: "This is an example template for use in the templates extension." example2: name: "Example Template 2" previewImage: "EXT:pagetemplates/ext_icon2.svg" description: "This is an example template for use in the templates extension."
键是模板标识符(单个模板配置的文件名)。名称、预览图像和描述用于显示所选模板的预览。
单个模板配置看起来像这样
page: description: this is a superb description of the template onCreateEditFields: title,description defaults: title: some title description: and a description tt_content: 1: description: This content element should be used for blobbber onCreateEditFields: header defaults: header: a content element header CType: div colPos: 0 2: description: a hidden element which will only be created defaults: header: some other content element CType: div colPos: 0 3: description: and a third element onCreateEditFields: header,subheader defaults: header: enter something sensible here, please CType: textmedia bodytext: some default bodytext stuff
请注意,您只能配置存储在页面上的表并且具有pid字段。
YAML模式的使用
- 在主模块菜单中单击模块
- 选择父页面
- 选择模板
- 填写模板变量
- 单击“保存新页面”
简单模式的使用
- 在页面树中选择一个页面并打开上下文菜单
- 选择“从模板创建页面”