form-builder icon indicating copy to clipboard operation
form-builder copied to clipboard

Allow inline editing of labels when used with Fusion rendering

Open Sebobo opened this issue 7 years ago • 1 comments

As we previously discussed I think it would be a great feature to make the form labels (and maybe later other text) inline editable.

This would be part of a long term goal to make the already good form building even less "clicky" and less context switching.

As this should be fairly easy to implement in Fusion I would recommend to just implement it when the fusion renderer is being used. I would also assume that this will be the recommended form rendering in the future.

I tried implementing this but I'm currently unsure how to check in the form builder code if the renderer is the fusion renderer.

If I could override the fusion renderer prototypes from the form builder package It would still be standalone but would just add the functionality when both are being used together.

@bwaidelich can you give me a pointer where to start?

Thanks Sebastian

Sebobo avatar May 05 '18 09:05 Sebobo

One mostly working way (problem with the required flag) to make the label editable is modifying the fusion based label like this:

prototype(Neos.Form.FusionRenderer:FormElementLabel) < prototype(Neos.Fusion:Tag) {
    tagName = 'label'
    attributes {
        for = ${element.uniqueIdentifier}
        [email protected] = ${!(element.renderingOptions._node && documentNode.context.inBackend)}
    }
    content = Neos.Fusion:Array {
        value = ${Neos.Form.translateAndEscapeProperty(element, 'label')}
        requiredFlag = Neos.Form.FusionRenderer:RequiredFlag
        [email protected] = ${element.required}
    }

    @process.inlineEditable = Neos.Neos:ContentElementEditable {
        node = ${element.renderingOptions._node}
        property = 'label'
        @if.nodeBased = ${element.renderingOptions._node}
    }
}

The question is where to put this :)

Sebobo avatar May 05 '18 10:05 Sebobo