【问题标题】:TYPO3: Adding a Javascript Module to the Backend?TYPO3:向后端添加 Javascript 模块?
【发布时间】:2020-07-02 10:08:02
【问题描述】:

我尝试添加自定义表单元素并在此处遵循本教程:https://gist.github.com/manuelselbach/dc63abd313694c594d480b163a5f3053

除了 JS 模块部分外,一切正常。每次我尝试加载我的表单时,我都会收到一个 404 错误,即找不到模块,我真的不知道为什么或如何将它添加到我的后端。

我的文件夹结构如下:

typo3conf
    ext
       tjms
          Configuration
             Form
                 CustomFormSetup.yaml
                 FormEditorSetup.yaml
             Resources
                Public
                   js
                      TjmsTabsViewModel.js

在我的 FormEditorSetup.yaml 中,我添加了这个 yaml 代码:

TYPO3:
  CMS:
    Form:
      prototypes:
        standard:
          formEditor:
            dynamicRequireJsModules:
              additionalViewModelModules:
                1588750194: "/TYPO3/CMS/tjms/TjmsTabsViewModel"

            formEditorPartials:
              FormElement-TjmsTabs: "Stage/SimpleTemplate"

          formElementsDefinition:
            TjmsTabs:
            formEditor:
              label: "formEditor.elements.TjmsTabs.label"
              group: custom
              groupSorting: 1000
              iconIdentifier: "form-multi-checkbox"
      mixins:
        formElementMixins:
          TjmsTabsMixin:
            __inheritances:
              10: "TYPO3.CMS.Form.mixins.formElementMixins.FormElementMixin"

我的 CustomFormSetup.yaml:

TYPO3:
  CMS:
    Form:
      persistenceManager:
        allowedExtensionPaths:
          100: EXT:tjms/Resources/Private/Forms/
        allowSaveToExtensionPaths: true
        allowDeleteFromExtensionPaths: true
      prototypes:
        standard:
          formElementsDefinition:
            Form:
              renderingOptions:
                templateRootPaths:
                  100: "EXT:tjms/Resources/Private/Forms/Templates/"
                partialRootPaths:
                  100: "EXT:tjms/Resources/Private/Forms/Partials/"
                layoutRootPaths:
                  100: "EXT:tjms/Resources/Private/Forms/Layouts/"
          formEditor:
            formEditorPartials:
              FormElement-TjmsTabs: "Stage/SimpleTemplate"

            TjmsTabs:
              __inheritances:
                10: "TYPO3.CMS.Form.mixins.formElementMixins.TjmsTabsMixin"
      mixins:
        formElementMixins:
          TjmsTabsMixin:
            __inheritances:
              10: "TYPO3.CMS.Form.mixins.formElementMixins.FormElementMixin"

我的插件和模块中都包含了 yaml 文件。但是每次我进入我的后端 > 表单 > 我的测试表单时,我都会收到错误消息:

GET http://localhost/TYPO3/CMS/tjms/Backend/FormEditor/TjmsTabsViewModel?bust=d0e6c9adcc1da3f6a39dbdc7b27b9817bcb662c5 net::ERR_ABORTED 404 (Not Found)

VM20251 require.js:1 Uncaught Error: Script error for "/TYPO3/CMS/tjms/Backend/FormEditor/TjmsTabsViewModel"
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.js:1)
    at HTMLScriptElement.onScriptError (require.js:1)

有人知道为什么它不起作用吗?

我在 docker 设置中使用 TYPO3 版本 9.5.18

感谢您的帮助!

【问题讨论】:

    标签: yaml typo3 typoscript typo3-9.x


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-02-23
      • 2020-04-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多