b13 / form-custom-templates
启用使用TYPO3表单框架邮件结束器发送的电子邮件的自定义模板
2.0.0
2024-02-16 09:27 UTC
Requires
- php: ^8.1
- typo3/cms-core: ^11.5 || ^12.3
- typo3/cms-filelist: ^11.5 || ^12.3
- typo3/cms-form: ^11.5 || ^12.3
- typo3/cms-frontend: ^11.5 || ^12.3
- typo3/cms-install: ^11.5 || ^12.3
Requires (Dev)
- codeception/codeception: ^4.1
- codeception/module-asserts: ^1.2
- codeception/module-webdriver: ^1.1
- phpstan/phpstan: ^1.4.8
- typo3/coding-standards: ^0.4.0
- typo3/testing-framework: ^6.16.2
- dev-main
- v12.x-dev
- 2.0.0
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.9.2
- 0.9.1
- 0.9
- 0.8
- 0.7
- 0.6
- 0.5
- 0.4
- 0.3
- 0.2
- 0.1
- dev-labeldValues
- dev-bugfix/empty-page
- dev-bugfix/php-warning
- dev-task/hide-fields-disable-indexing
- dev-davidsteeb-patch-1
- dev-task/compatability-v12
- dev-bugfix/uri
- dev-bugfix/modify-tca-only-for-email
This package is auto-updated.
Last update: 2024-08-24 14:09:47 UTC
README
允许用户为每个邮件结束器定义电子邮件模板,并在插件设置中覆盖它。
默认情况下使用全局定义的模板。需要配置额外的模板!
安装
composer req b13/form-custom-templates
配置
Doktype 和 typeNum
如果当前TYPO3实例中已经使用了doktype
(默认:125)或typeNum
(默认:101),则可以在设置 -> 扩展配置中更改这两个值。常量plugin.tx_form_custom_templates.doktype
和plugin.tx_form_custom_templates.typeNum
将根据扩展配置中设置的值自动设置。
添加TypoScript配置
使用@import
或include_static_file
添加基本配置。
@import 'EXT:form_custom_templates/Configuration/TypoScript/setup.typoscript'
这将扩展EmailToSender
和EmailToReceiver
结束器,并添加一个模板选择器。模板选择器将列出所有doktype Email(插件.tx_form_custom_templates.doktype默认:125)的页面。默认情况下,使用基于SystemEmail.html
的模板的页面类型Email。
自定义HTML模板
[page["doktype"] == {$plugin.tx_form_custom_templates.doktype}]
# Set the template
page.10.templateName = SystemEmailTemplate
# Use custom template paths
page.10.templateRootPaths.20 = EXT:SITE_PACKAGE/Resources/Private/Frontend/Templates/
page.10.partialRootPaths.20 = EXT:SITE_PACKAGE/Resources/Private/Frontend/Partials/
page.10.layoutRootPaths.20 = EXT:SITE_PACKAGE/Resources/Private/Frontend/Layouts/
[END]
自定义结果列表模板
定义文件路径(省略后缀)。需要html和txt格式的模板。
plugin.tx_form_custom_templates.resultList.templatePath = EXT:form_custom_templates/Resources/Private/Frontend/Partials/ResultTable
定义默认模板
module.tx_form.settings.yamlConfigurations.555 = EXT:YOUR_SITE_PACKAGE/Configuration/Yaml/CustomTemplate.yaml
plugin.tx_form.settings.yamlConfigurations.555 = EXT:YOUR_SITE_PACKAGE/Configuration/Yaml/CustomTemplate.yaml
TYPO3: CMS: Form: prototypes: standard: finishersDefinition: EmailToSender: formEditor: predefinedDefaults: options: emailTemplateUid: '221'