简体   繁体   中英

TYPO3 Neos: Create own inspector/editor

I try to create an own editor for the page panel on the right side. For this I use at beginning the HTML-Editor. This will work so far. After this I tried to adapt it for my package but I'll get always the error from requirejs :

Error: Script error for: My.Package/Inspector/Editors/MyEditor 
http://requirejs.org/docs/errors.html#scripterror

For two days I tried to find out where the error starts, but fail. Is this warning in the documentation the reason?

Adding editors and validators is no fixed API yet, keep an eye on the changelogs if you use this.

To reproduce the error do the following:

  • Using TYPO3 Neos version 1.1.0
  • Create a package named "My.Package"
  • Copy the HTMLEditor to Packages/Application/My.Package/Resources/Public/JavaScript/Inspector/Editors/MyEditor.js
  • Define Settings.yaml and NodeTypes.yaml

Settings.yaml:

TYPO3:
  Neos:
    userInterface:
      # Register editor
      requireJsPathMapping:
        'My.Package/Inspector/Editors': 'resource://My.Package/Public/JavaScript/Inspector/Editors/'

NodeTypes.yaml:

'TYPO3.Neos.NodeTypes:Page':
  properties:
    settings:
      type: string
#      defaultValue: '<p>Enter HTML here</p>'
      ui:
        label: 'Settings'
#        reloadIfChanged: TRUE
        inspector:
          group: 'layout'
          editor: 'My.Package/Inspector/Editors/MyEditor'

The expected behaviour should be to display the property "Settings" after "Layout for subpages of this page" followed by a button like at the HTML content element.

这个问题的答案是,您的示例按照声明的方式工作,但是您有一个广告拦截器阻止了对自定义编辑器脚本的请求。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM