Hi @BenjaminK,
ah yes, I can use ContentCase of course, that did the trick.
Thanks for the adjustments, I get the idea, but taking this behaviour one step further got me stuck again.
Now, while all this configuration for a ‘Text’ is clear, I would like to return to my more general problem, like I mentioned in my first post :
I am still going through the basics, I am now a bit familiar with rendering Neos.Neos:ContentCollection data in my project and I’m trying to get things simpler.
So, instead of having a Neos.Neos:ContentCollection, I am trying to render a simple text field of type Neos.NodeTypes:Text.
So, we managed to get the simple Text to be loaded without being wrapped in a ContentCollection, but what happens with all the other fields that a ContentCollection can render ? I don’t see how I can apply this solution with a menu for example, or even my custom prototype that I had made to be able to render a block of multiple text fields.
Specifically, in order to render a custom content block, I have the following structure:
# NodeTypes.yaml
'Neos.NodeTypes:Page':
childNodes:
'heroText':
type: 'Neos.Neos:ContentCollection'
constraints:
nodeTypes:
'*': FALSE
'Vendor.Site:HeroText': TRUE
'Vendor.Site:HeroText':
superTypes:
'Neos.Neos:Content': TRUE
ui:
label: 'Hero Text'
group: 'general'
inspector:
groups:
image:
label: 'Image'
icon: 'icon-image'
position: 1
properties:
headline:
type: string
defaultValue: 'Enter headline'
ui:
label: 'Headline'
inlineEditable: TRUE
subheadline:
type: string
defaultValue: 'Enter subheadline'
ui:
label: 'Subheadline'
inlineEditable: TRUE
text:
type: string
ui:
label: 'Text'
reloadIfChanged: TRUE
Then in fusion
// HeroText.fusion
prototype(Vendor.Site:HeroText) < prototype(Neos.Neos:Content) {
templatePath = 'resource://Vendor.Site/Private/Templates/FusionObjects/HeroText.html'
headline = ${q(node).property('headline')}
subheadline = ${q(node).property('subheadline')}
text = ${q(node).property('text')}
}
// Root.fusion
page = Neos.Neos:Page {
body {
content {
heroText = Neos.Neos:ContentCollection {
nodePath = 'heroText'
}
}
}
}
Then I render it properly in my .html files, I believe you get the idea. Everything works well with this approach, but like I said, I want to get rid of the dynamic rendering of contentCollection. I want the field to be there by default and editable right away. But, what I have now is that the user needs to click the “Add” button on the contentCollection tool and select the HeroText and (s)he can also add more than one of these blocks. This is the reason I want to get rid of the default behaviour, but I want to still have consistent configuration options when it comes to text, menu, or custom prototype.
As always, I am grateful for your help !