Node Creation Dialog Confi­gura­tion

When creating new nodes, you have the possibility to ask for additional data during node creation. This data will be passed to nodeCreationHandlers.

The creation dialog supports most of the inspector editors, except of those that require to show a secondary inspector view. See Property Editor Reference for more details about configuring inspector editors.

For example, this functionality can be used to ask users for some data before creating an instance of the corresponding node:

SomeNodeType.yaml
'Some.Package:SomeNodeType':
  ui:
    group: 'general'
    creationDialog:
      elements:
        'someElement':
          type: string
          ui:
            label: 'Some Label'
            editor: 'Neos.Neos/Inspector/Editors/TextFieldEditor'
          validation:
            'Neos.Neos/Validation/NotEmptyValidator': []
  options:
    nodeCreationHandlers:
      documentTitle:
        nodeCreationHandler: 'Some\Package\NodeCreationHandler\SomeNodeCreationHandler'

You may register multiple nodeCreationHandlers per NodeType. Each nodeCreationHandler must implement NodeCreationHandlerInterface. It gets the newly created $node and the $data coming from the creation dialog.
See Neos\Neos\Ui\NodeCreationHandler\DocumentTitleNodeCreationHandler for example that is used to set the Document node's title and uriPathSegment as soon as the node is created.

 

Note

The elements of the creation dialog define an arbitrary set of data that will be passed to a nodeCreationHandler. Those elements will not automatically set node properties in any way. To take action based on that data you would need to write a custom node creation handler or use the "showInCreationDialog" feature described below.

#Add node properties to the Node Creation Dialog

Since Neos 5.1 it has become very easy to add elements to the Node Creation Dialog that represent properties of the corresponding node:

SomeNodeType.yaml
'Some.Package:SomeNodeType':
  # ...
  properties:
    'someProperty':
      type: string
      label: 'Some Label'
      ui:
        showInCreationDialog: true

When using the showInCreationDialog feature, the editor options of the corresponding ui.inspector configuration is applied. If needed, the configuration can be overridden for the Node Creation Dialog like described above:

SomeNodeType.yaml
'Some.Package:SomeNodeType':
  # ...
  ui:
    creationDialog:
      elements:
        'someProperty':
          ui:
            label: 'Overridden label'
            editorOptions:
              placeholder: 'Some placeholder only visible in the Node Creation Dialog'
  properties:
    'someProperty':
      type: string
      label: 'Some Label'
      ui:
        showInCreationDialog: true

Note

This feature was added with Neos 5.1. For older versions you can use the 3rd party Wwwision.Neos.CreationDialogProperties package for a similar functionality.

Using Images in the Node Creation Dialog

Most property editors just work out of the box when being used in the Node Creation Dialog. The following editors are an exception because they require a secondary view that is currently not supported by the Creation Dialog (see corresponding Bug ticket):

  • Neos.Neos/Inspector/Editors/ImageEditor
  • Neos.Neos/Inspector/Editors/AssetEditor
  • Neos.Neos/Inspector/Editors/RichTextEditor
  • Neos.Neos/Inspector/Editors/CodeEditor

So when used in conjunction with the showInCreationDialog flag, these editors are disabled by default.

You can, however, override that behavior if you want to allow images to be uploaded (all features that require a secondary editor won't work and should be disabled):

SomeNodeType.yaml
'Some.Package:SomeNodeType':
  # ...
  ui:
    creationDialog:
      elements:
        'someImageProperty':
          ui:
            editorOptions:
              disabled: false
              features:
                crop: false
                resize: false
                mediaBrowser: false
  properties:
    'someImageProperty':
      type: 'Neos\Media\Domain\Model\ImageInterface'
      label: 'Some Label'
      ui:
        showInCreationDialog: true


There are community packages which can help to define the node creation in Fusion only: