質問

I want to make a custom content type with the possibility to edit a download file. In my NodeTypes.yaml I have:

'Vendor.Prefix:MyContentType':
  superTypes: ['TYPO3.Neos:Content']
  ui:
    label: My Content Type
    icon: 'icon-file-text'
    inspector:
      groups:
        'props':
          label: Properties
  properties:
    'title':
      type: string
      defaultValue: 'Example Title'
      ui:
        label: 'Title'
        inlineEditable: TRUE

Now - how do I create a file upload field? I only found working examples for image fields:

'chapterImage':
  type: 'TYPO3\Media\Domain\Model\ImageVariant'
  ui:
    label: 'Chapter image'
    reloadIfChanged: TRUE
    inspector:
      group: 'document'

In the same folder, there are classes for file uploads, but this doesn't work:

'grundriss':
  type: 'TYPO3\Media\Domain\Model\Document'
  ui:
    label: 'Grundriss'
    editor: 'TYPO3.Neos/Inspector/Editors/FileUpload'
    inspector:
      group: 'props'

Neither with nor without the 'editor' line. It leads to the JavaScript error:

Uncaught TypeError: Cannot read property 'editor' of undefined 
Uncaught Error: You cannot modify child views while in the inBuffer state 

And to an empty property inspector.

Has anyone a tip for me?

役に立ちましたか?

解決

True enough this was not working. We have merged a way to link to all kinds of asset files in the current 1.1 beta release. Maybe check that.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top