Skip to content

Commit

Permalink
New: Add fallback value for editable
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto authored Apr 16, 2021
1 parent a3f3a61 commit 4779ac1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Resources/Private/Fusion/Editable/Editable.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ prototype(Carbon.BackendDocument:Editable) < prototype(Neos.Fusion:Component) {
// Be aware! If one elment on a document has set this to true, this get's included for the whole document
includeCSS = true

// Fallback for the frontend if no value is given
fallback = null

// Internal
block = ${this.type == 'block'}
value = ${q(this.node).property(this.property)}
Expand All @@ -59,7 +62,7 @@ prototype(Carbon.BackendDocument:Editable) < prototype(Neos.Fusion:Component) {
@if.hasNodeAndPropertyAndType = ${this.node && this.property && Type.isString(this.type)}

renderer = afx`
{!props.inBackend && props.value ? props.value : ''}
{!props.inBackend ? (props.value || props.fallback) : ''}
<div
@if.set={props.inBackend}
class={[BEM.modifier('carbon-backenddocument-editable', props.inspectorStyle ? 'inspector' : 'default'), props.class]}
Expand Down

0 comments on commit 4779ac1

Please sign in to comment.