【问题标题】:TYPO3 Form Multicheckbox PartialTYPO3 表单多复选框部分
【发布时间】:2021-05-07 18:19:17
【问题描述】:

我尝试编辑核心文件 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,但它对前端没有影响。

【问题讨论】:

  • 请描述您已经采取了哪些步骤以及您的配置如何。根据提供的信息,无法提供任何建议。
  • 你不是在编辑核心文件???对于覆盖模板,请查看文档:docs.typo3.org/c/typo3/cms-form/master/en-us/I/FAQ/…
  • 谢谢!我已经编辑了我的问题。

标签: forms typo3 partials typo3-10.x


【解决方案1】:

非常感谢您的意见。问题是由于引导程序包。文件夹“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/'

同样的错误。

【讨论】:

  • 1.注意配置的级联。 *Paths 应该有多个有序条目。至少,应该(具有最低索引)回退到 EXT:form 的路径。 2. 不确定是错误还是您的帖子:请注意您的 YAML 文件中的缩进。在这两个 sn-ps 中,“CMS:”和“Form:”(以及它们的子级)的缩进都丢失了
  • 错误的缩进只在此处,不在文件中。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-09-28
  • 1970-01-01
  • 1970-01-01
  • 2014-07-09
相关资源
最近更新 更多