I want to access the column setting of a column in a multicolumn layout from a node inside the column. The information should be used to change rendering behaviour.
will never give you anything. What you’re doing in your FlowQuery here is to read the closest parent nodetype that is of type Neos.NodeTypes:MultiColumnItem. However, there is no such node type - only a Fusion prototype that is essentially just a ContentCollection, so all it does is render the things inside the column.
The node type you’re looking for is Neos.NodeTypes.ColumnLayouts:Column, so your first query should be:
Notice the changed property name: it’s “layout”, not “columnLayout” - you can have a look at the nodetype definition (in package Packages/Application/Neos.NodeTypes.ColumnLayouts/Configuration/NodeTypes.Content.Column.yaml and check that for yourself.
Secondly, it does not matter at all what you define in the Fusion prototype of your MultiColumnItem - any Fusion objects that get rendered by it cannot read those properties unless you pass them inside explicitly or put them in the context, which you haven’t done here. So essentially there are two way to get that layout from inside a rendered content prototype:
Read it explicitly from the parent node, which is done by the Fusion above
Get it set by the parent Fusion object’s context. You are not doing this in your second Fusion snippet, but it’s already done by default in the Neos.NodeTypes.ColumnLayouts:MultiColumn prototype. Have a look in Packages/Application/Neos.NodeTypes.ColumnLayouts/Resources/Private/Fusion/Root.fusion, and you will find this line: @context.columnLayout = ${q(node).property('layout')}. This makes the property “layout” from the Column nodetype available as a context variable named “columnLayout”. This means getting that from any Fusion prototype rendered inside is as easy as: columnLayout = ${columnLayout}
No worries, glad I could help you. Understanding the distinction between node types and Fusion prototypes is probably the single hardest thing to get when you learn Neos, I still remember this from when I started