jvmtech / nodeaggregateproperties
Node aggregate-properties emulation for Neos 8
Package info
github.com/jvm-tech/NodeAggregateProperties
Type:neos-plugin
pkg:composer/jvmtech/nodeaggregateproperties
Requires
- neos/neos: ^8.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Emulates node aggregate-scoped properties on Neos 8. Neos 9 introduces native support for properties
scoped to the whole node aggregate instead of a single dimension variant; this package backports that
behavior to Neos 8 ahead of the upgrade. The scope: 'nodeAggregate' property configuration is
compatible with Neos 9, so NodeTypes configured for this package require no changes once the project
upgrades.
Properties marked with scope: 'nodeAggregate' are automatically replicated across all dimension
variants of a node whenever one variant is changed, so the property behaves as if it were shared by
the whole node aggregate rather than a single variant.
This package is inspired by PunktDe.NodeReplicator.
How it works
NodeSignalInterceptorlistens forNode::nodePropertyChangedand checks whether the changed property is configured withscope: 'nodeAggregate'.NodeReplicatorthen propagates the new value to all other dimension variants of that node, guarding against infinite recursion while doing so.NodeTypePostProcessoroptionally adds a help message to the backend UI for everynodeAggregate-scoped property, so editors understand that the value applies to all languages/dimensions.
Configuration
'Some.Package:SomeNodeType': properties: someProperty: scope: 'nodeAggregate'
Package settings (Settings.yaml):
JvMTECH: NodeAggregateProperties: setHelpMessage: true overrideHelpMessage: false helpMessagePath: 'JvMTECH.NodeAggregateProperties:Main:ui.help.message'
setHelpMessage— whether to add the help message tonodeAggregate-scoped properties.overrideHelpMessage— whether to override an existingui.help.messageon the property.helpMessagePath— the translation path used for the help message.