首页 > 解决方案 > TYPO3 表单多复选框部分

问题描述

我尝试编辑核心文件 form\Resources\Private\Frontend\Partials\Field\Field.html 以更改前端的 html 输出。如果我更改该文件,它没有效果。如果我更改核心文件 form\Resources\Private\Frontend\Partials\Textarea.html 它会影响前端的输出。

我尝试像这样设置自定义部分、布局和模板文件夹:我在页面模板的设置部分设置了以下内容:

plugin.tx_form {
settings {
    yamlConfigurations {
        # register your own additional configuration
        # choose a number higher than 30 (below is reserved)
        100 = fileadmin/my_site_package/Configuration/Form/CustomFormSetup.yaml
    }
}
}

在 fileadmin/my_site_package/Configuration/Form/CustomFormSetup.yaml 我有

TYPO3:
CMS:
Form:
  prototypes:
    standard:
      formElementsDefinition:
        Form:
          renderingOptions:
            templateRootPaths:
              20:'fileadmin/my_site_package/Resources/Private/Templates/Form/Frontend/'
            partialRootPaths:
              20: 'fileadmin/my_site_package/Resources/Private/Partials/Form/Frontend/'

在文件夹 fileadmin/my_site_package/Resources/Private/Partials/Form/Frontend/ 我有从表单核心文件夹复制的 Multicheckbox.html 和其他复制的部分文件。我已经编辑了 Multicheckbox.html,但它对前端没有影响。

标签: formstypo3partialstypo3-10.x

解决方案


非常感谢您的意见。问题是由于引导程序包。文件夹“typo3conf/ext/bootstrap_package/Resources/Private/Partials/Form”中有一个文件 Multicheckbox.html。这个覆盖了核心文件 Multicheckbox.html

但是我在我的步骤中做错了什么?我现在在前端收到以下错误:

糟糕,发生错误!尝试以“.html”格式解析控制器操作“FormFrontend->form”的模板文件,但没有一个路径包含预期的模板文件(FormFrontend/Form.html)。未配置路径。有关此错误的更多信息可能在线提供。

我是否在 CustomFormSetup.yaml 中设置了错误的路径?我也试过

TYPO3:
CMS:
Form:
  prototypes:
    standard:
      formElementsDefinition:
        Form:
          renderingOptions:
            templateRootPaths:
              1:'/my_site_package/Resources/Private/Templates/Form/Frontend/'
            partialRootPaths:
              1:'/my_site_package/Resources/Private/Partials/Form/Frontend/'

有同样的错误。


推荐阅读