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

Adding help labels #64

Closed
daviddavo opened this issue Feb 16, 2023 · 5 comments
Closed

Adding help labels #64

daviddavo opened this issue Feb 16, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@daviddavo
Copy link
Contributor

If you create a form and you want to add help labels, you'll have to do it manually. It'd be nice to be able to do it in sherlockode_configuration, perhaps alongside label or inside options.

If this is already possible, we could just add it to the README

@Vowow
Copy link
Contributor

Vowow commented Feb 16, 2023

Hello,

This is not yet possible but could be an interesting feature.
One problem though is that we don't provide any style or JS in the bundle and we are not sure we want to provide one.
If I had to do it in a project, I'll do a form_theme inside my project, not sure if it should be packaged within this bundle.
What kind of feature have you got in mind ? Something like a tooltip ?
You can still provide us a Pull request for this one and we'll be happy to review it !

@daviddavo
Copy link
Contributor Author

I tried just adding help to the $baseOptions and it just works. Symfony's default form themes work fine with it.

$baseOptions = [
'label' => $definition->getLabel(),
'required' => $definition->getOption('required', true),
'attr' => $definition->getOption('attr', []),
'row_attr' => $definition->getOption('row_attr', []),
'label_attr' => $definition->getOption('label_attr', []),
'translation_domain' => $definition->getTranslationDomain(),
];

I will open a PR as soon as I can

@Vowow
Copy link
Contributor

Vowow commented Feb 16, 2023

This could be done by using options directly in our bundle like this :

my_config_field:
    label: parameters.tarte_au_citron_id
    type: simple
    options:
        required: false
        help: 'toto'

Could be interesting to give in baseOptions all the options that are inherited in Symfony form components though.
I'll review the PR and maybe amend to give more options to the user, it's a good idea

@daviddavo
Copy link
Contributor Author

@Vowow Vowow added the enhancement New feature or request label Feb 17, 2023
@juchi
Copy link
Member

juchi commented Feb 24, 2023

PR has been merged

@juchi juchi closed this as completed Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants