I have a few childNodes in my Page NodeType and I want to also pass a default value to them, is it possible to do this through yaml or alternatively in fusion ?
Specifically, consider the following NodeTypes.yaml
Now, everything is alright, but when my node is empty I see a floating “Enter text here” placeholder, but instead of that I would like to render the field with a default value which I can specify to be different every time I use this child node. How can I do this ? I tried adding the defaultValue under the childNode definition in yaml but didn’t help:
thanks for your help, but while rendering the default value, I am not able to edit it. Am I doing something wrong ?
I can’t find where the renderer is defined, but maybe I have to override the renderer default value instead of the whole renderer object or whatever it is that renders my variable as editable in the backend ?
I added parentNode: [ ] like the documentation suggests and this just results in an extra empty option in the select box. I also tried replacing parentNode with ‘Neos.NodeTypes:TwoColumn’ without success. I’m sure this is doable through the configuration, the documentation says it, maybe the syntax changed ?
You can’t edit the default value since it is defined through Fusion during the rendering process, but is not stored anywhere. Maybe you could explain you use case a bit more detailed.
If you try to use the default value as placeholder for editing in backend, you can set a placeholder for aloha. (This is actually not documented at readthedocs.io)
property:
ui:
aloha:
placeholder: 'Enter title here'
Here you can just render an editable Tag like this:
If you also want your default Value to be rendered if nothing is specified within the backend you have to change your Fusion code to:
text = Neos.Fusion:Case {
value {
condition = ${q(node).property('property') != null || node.context.inBackend == true}
renderer = Neos.Fusion:Tag {
tagName = 'div'
content = ${q(node).property('property')}
@process.edit = ContentElementEditable {
property = 'property'
}
}
}
default {
condition = ${true}
renderer = Neos.Fusion:Tag {
tagName = 'div'
content = 'My cool default value'
}
}
}
```
Like this it should work. If it still doesn't maybe I got your explanation wrong.
Now it renders the Tag with the actual set content or with the default value in live, while always rendering the editable version in backend.