eZ Platform Discussions

[eZ EE 2.4] [Form] Add help for admin on custom field type


#1

I continue my investigation on the forms.

I have a special field that allows the admin to generate a select field that will be used to send the message to specific addresses.

Ideally this field should be a matrix. (A little like the Author ContentFieldType)

But right now it’s a textarea.

image

What I want for now is simply to add a little text to help the admin remember the rules: “One line per entry in the select. Email label separator:’|’. Email separator: ‘;’ '”

My field :

ez_platform_form_builder:
    fields:
        select_recipient:
            name: 'Sélectionner le destinataire'
            thumbnail: '/bundles/ezplatformadminui/img/ez-icons.svg#dropdown'
            attributes:
                help:
                    name: 'Help'
                    type: 'string'
                recipients:
                    name: 'Destinataires'
                    type: 'text'
            validators:
                required: ~

The best would be an admin_help param:

fields:
        select_recipient:
            name: 'Sélectionner le destinataire'
            thumbnail: '/bundles/ezplatformadminui/img/ez-icons.svg#dropdown'
            attributes:
                recipients:
                    name: 'Destinataires'
                    type: 'text'
                    # This example is only a representation of what would be great. But it doesn't exist yet. 
                    admin_help:  |
                       One line per entry in the select. 
                       Label/Emails separator:'|'. 
                       Emails separator: ';'

And of course we must not forget the translation problems…

But maybe it’s easier to manage via a template?