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

Possibility to add an icon to any form type #2623

Open
vitek-rostislav opened this issue Jun 6, 2023 · 1 comment
Open

Possibility to add an icon to any form type #2623

vitek-rostislav opened this issue Jun 6, 2023 · 1 comment

Comments

@vitek-rostislav
Copy link
Contributor

Describe the expected outcome of your requested feature

In administration, there are a few form types that allow adding an icon, icon title, or symbol after input. This is ensured by appendix_block in theme.html.twig. I would like to have the possibility in all the form types (e.g. it would be very handy in DisplayOnlyType.) I have to implement it myself on my project now - extending displayOnlyFields.html.twig template, add {{- block('appendix_block') -}} there, and then define the icon in my form type extension by adding

'attr' => [
                    'readonly' => 'readonly',
                    'class' => '',
                    'icon' => true,
                    'iconTitle' => 'whatever',
                ]

(I have to re-define the default values of the first two attributes - readonly and class - to make it work).

@vitek-rostislav
Copy link
Contributor Author

Today, I figured, I do not need to re-define the class atribute default value in teh form type - I can add the default value in the theme:

+ <div class="form-line {{ attr.class|default('') }}">
- <div class="form-line {{ attr.class }}"> 

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

2 participants