Change the Context of a Editable Property

Did you know that it is possible to change the Context of a editable property?
This could be really helpful if you have a "sitewide" Property that should be editable on all sites where it appears. If you have a ContentCollection that should be the same "sitewide" then you should check out the Header & Footer Menu Example!

If you want to change the context of a editable property then you need to set the option `node` of Neos.Neos:Editable to the node where your property is that you want to change. You also need to add a `Neos.Neos:ContentElementWrapping` to your `Neos.Neos:Editable` with the same `node` option. Otherwise the value will be displayed but it is not editable.

 

prototype(Arsors.Neos:editableContext) < prototype(Neos.Neos:ContentComponent) {

    exampleText = Neos.Neos:Editable {
        property = 'exampleProperty'
        node = ${site}
        @process.contentElementWrapping = Neos.Neos:ContentElementWrapping {
            node = ${site}
        }
    }

    renderer = afx`
    <p>{props.exampleText}</p>
    `

}

Last cache from 2021-05-13 at 21:30:33 (Example Eel Helper)