Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow inline editing of labels when used with Fusion rendering #29

Open
Sebobo opened this issue May 5, 2018 · 1 comment
Open

Allow inline editing of labels when used with Fusion rendering #29

Sebobo opened this issue May 5, 2018 · 1 comment

Comments

@Sebobo
Copy link
Member

Sebobo commented May 5, 2018

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
Copy link
Member Author

Sebobo commented May 5, 2018

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant