MultiColumn for unlimited items


(Bernhard Witz) #1

The ThreeColumn NodeType with some adjustments does exactly what I need.

Now I would like to have exactly the same construction but for unlimited items. The rendered HTML should look like this:

<div class="grid--container grid--special">
    <div class="column column-4 column--mobile-6">
        <div class="item">First content</div>
        <div class="item">Second content</div>
        <div class="item">Third content</div>
        <div class="item">Fourth content</div>
        <div class="item">Fifth content</div>
        <div class="item">Sixth content</div>
        <div class="item">etc.</div>
    </div>
</div>

Maybe this would be possible with the built in Column NodeType in Neos. But if I want to use it I get this error:

The fluid file “resource://Neos.NodeTypes/Private/Templates/NodeTypes/Column.html” was not found

Does someone has an idea what I could do?


(Soren Malling) #2

You need to override the path for the Column template. It’s most likely called something like templatePath in your fusion code


(Bernhard Witz) #3

Thanks @sorenmalling for your answer! I tried to find out where I could add a new templatePath but with my limited Neos knowledge I didn’t figure it out.

When I add the following code then the error is gone but I get a new one in the backend:

TypeError: Cannot convert undefined or null to object

Here is what I added in my fusion code and the template (MultiColumn.html) I copied into my package:

ColumnAdjustments.fusion

prototype(Neos.NodeTypes:Column) {
    templatePath = 'resource://My.Package/Private/Templates/NodeTypes/Column.html'
}

Column.html

<div{attributes -> f:format.raw()}>
    {columns -> f:format.raw()}
</div>