More specific reference editor

Hi there,

I’m currently working on a Neos project, where I have the following NodeTypes.

'MyProject:Parent':
  childNodes:
    a:
      type: 'Neos.Neos:ContentCollection'
      constraints:
        nodeTypes:
          '*': false
          'MyProject:A': true
    b:
      type: 'Neos.Neos:ContentCollection'
      constraints:
        nodeTypes:
          '*': false
          'MyProject:B': true

'MyProject:A':

'MyProject:B':
  properties:
    refA:
      type: reference
      ui:
        label: 'A'
        inspector:
          editorOptions:
            nodeTypes: ['MyProject:A']

Essentially, the node ‘Parent’ has two childnode collections, one consisting only of ‘A’ nodes and the other only ‘B’ nodes. Now inside the ‘B’ nodes I’d like to select a node of type ‘A’. However, this selection should be restricted to the ‘A’ nodes inside the same ‘Parent’ node.
Is there a way to accomplish this?

Thanks for your replies

HI Gabriel,

(I took the freedom to indent your yaml snippet to make it more readable - you can use the “Preformatted Text”-button to do that yourself if you wish)

With the built-in reference Property Editor you can restrict the selection of reference-nodes to a node path using the startingPoint option (see reference). However it’s not possible to do that dynamically for the current (parent) node AFAIK.

What you could do is to use the SelectBoxEditor with a custom Data source that retrieves the right nodes.

1 Like

Thank you for your hint Bastian (and the indentation :wink:)

I didn’t think of using a SelectBoxEditor with a custom data source. I’ll try with that.