luya-module-cms icon indicating copy to clipboard operation
luya-module-cms copied to clipboard

getFieldHelp support for multiple inputs block type

Open luya-bot opened this issue 7 years ago • 1 comments

This issue has originally been reported by @adipriyantobpn at https://github.com/luyadev/luya/issues/1769. Moved here by @nadar.


Have CMS Block with zaa-multiple-inputs type, which contains 2 fields or more, like this:

public function config()
{
    return [
        'vars' => [
            ['var' => 'features', 'label' => "Features", 'type' => 'zaa-multiple-inputs', 'options' => [
                ['var' => 'icon', 'label' => 'Icon', 'type' => 'zaa-select', 'options' => [...]],
                ['var' => 'title', 'label' => 'Title', 'type' => 'zaa-text'],
                ['var' => 'text', 'label' => 'Text', 'type' => 'zaa-wysiwyg'],
                ['var' => 'bgColor', 'label' => 'Bg. Color', 'type' => 'zaa-select', 'options' => [...]],
            ],
        ],
    ];
}

It would be nice if getFieldHelp() function can render help for each field inside zaa-multiple-inputs, too.

Structured array like this will be suffice.

public function getFieldHelp()
{
    return [
        'features' => [
            'icon' => 'Icon name, will be shown at the top of the each feature',
            'title' => 'Title of the feature',
            'text' => 'Some explaination',
            'bgColor' => 'Background color for feature box',
        ],
    ];
}

luya-bot avatar Feb 16 '18 11:02 luya-bot

For block fields, the help button is added to the corresponding zaa-directive by the CMS module. zaa-directives themselves haven't any help button.

zaa-multiple-inputs is defined by the Admin module. Adding help buttons there seems not consistent.

Which strategy could be used? Should prospectively zaa-directives have a help button by default?

hbugdoll avatar Oct 21 '21 10:10 hbugdoll