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

Easier way to override button #7306

Merged
merged 1 commit into from
Jul 12, 2021

Conversation

VincentLanglet
Copy link
Member

Subject

I am targeting this branch, because BC.

When you want to override a button label, or changing some design, you currently have to override the whole form actions, and copy paste all the logic.

With these new blocks, you can now override only one button without taking care bout the logic behind.
WDYT ?

Changelog

### Added
- New `block` twig in order to override the button display by the admin in the base_edit_form.

@VincentLanglet VincentLanglet requested a review from a team July 7, 2021 14:33
Copy link
Contributor

@dmaicher dmaicher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense to me 👍

@dmaicher dmaicher requested a review from a team July 9, 2021 07:54
Copy link
Member

@franmomu franmomu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we prefix these blocks with sonata_? looks like almost all of our blocks are prefixed

@VincentLanglet
Copy link
Member Author

Should we prefix these blocks with sonata_? looks like almost all of our blocks are prefixed

The block formactions wasn't using the prefix.
I know in some other template (for show or list), there is a block field without the template too.

I would say it's better without the prefix, all of these template are inside the sonata project, there is no need to add this extra prefix. To me is kinda the same than prefixing all the method with sonata, like getSonataDatagrid().

@franmomu
Copy link
Member

franmomu commented Jul 9, 2021

Based on sonata-project/dev-kit#205 (comment) looks like it was decided to add sonata_ prefix.

@VincentLanglet
Copy link
Member Author

Based on sonata-project/dev-kit#205 (comment) looks like it was decided to add sonata_ prefix.

This was voted 5 year ago, and I checked and have difficulties to call this a standard when 90% of the blocks of the SonataAdmin code are not prefixed by sonata_ and not plan was made to respect this standard. :/

This is more consistent to me to respect the "empirical standard" of this project. Since almost all the block are already not prefixed. WDYT @sonata-project/contributors ?

@dmaicher
Copy link
Contributor

I would say it's better without the prefix, all of these template are inside the sonata project, there is no need to add this extra prefix.

Yeah I would agree here. I don't see the benefit of those prefixes.

@VincentLanglet VincentLanglet merged commit ab65d97 into sonata-project:3.x Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants