TYPO3:向后端添加 Javascript 模块?
TYPO3: Adding a Javascript Module to the Backend?
我尝试添加自定义表单元素并按照此处的教程进行操作: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
感谢您的帮助!
我尝试添加自定义表单元素并按照此处的教程进行操作: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
感谢您的帮助!