On Custom Node document i want to create reference for all sites (multisite)

Hi Everyone,
I want to create a reference in admin side so that i can store site.

favouriteSite:
      type: reference
      ui:
        label: 'Favourite Site'
        inspector:
          group: 'settings'
          editorOptions:
            nodeTypes: [ 'Neos.Neos:Shortcut' ]
            startingPoint: '/sites'
            allowEmpty: false

In following code everything is working but the problem is i have 2 sites

Site A (contains few shortcuts)
Site B

Now i am seeing all shortcuts as well the result that i want is should only show Site A and Site B.Preformatted text

Hey Muhammad,

I’m not 100% sure wether I understood your question correctly, but with the nodeTypes editor option you can specify the types of nodes that you want to allow as references.
Just replace

nodeTypes: [ 'Neos.Neos:Shortcut' ]

with whatever node types you want to allow, e.g.:

nodeTypes: [ 'Your.PackageA:Homepage', 'Your.PackageB:Homepage', 'YourPackageB.PreformattedText' ]

Hi Bastian,
Thanks for your response.
Actually i am working on Multi-site

Site A
Site B
Site C

In reference i want the list of these sites only not any other document or node only list of these sites.

so that in feature if i add any other site (e.g Site D)
it should automatically be there.

Then you should use one specific homepage nodetype for all your root nodes or have different homepage nodetypes but let them have a common super type mixin nodetype and use that one for as filter in the editor.

1 Like

What Sebastian wrote, a common abstract node type like

'Some.Package:Homepage':
  abstract: true
  superTypes:
    'Neos.Neos:Document': true

and then custom node types for your homepages like

'Your.SiteA:Homepage':
  abstract: true
  superTypes:
    'Some.Package:Homepage': true
'Your.SiteB:Homepage':
  abstract: true
  superTypes:
    'Some.Package:Homepage': true

should work.

Fun fact: With Neos 9, homepage nodes will be required to have a Neos.Neos:Site super type (see #4621)